问题
I am trying to implement some static cells in a UITableView
using Xcode 6 beta 2 and Swift. I have successfully implemented dynamic cells.
When the user clicks on one of the dynamic cells there is a push segue to a new UITableViewController
for a UITableView
with static cells.
I have set this all up in Xcode and the segue works but when I drag a UILabel onto one of the static cells it just doesn't show up at run time. A few things that might help narrow down whats going on:
- The data source methods are not being implemented in the
UITableViewController
- If I set the background of one of the static cells to a particular color, that shows up at run time
Any advice much appreciated.
Thanks in advance
回答1:
I "fixed" the issue creating a new storyboard...
On a clean project it was working, maybe it's a bug?
回答2:
I believe this is the answer here:
https://stackoverflow.com/a/24708004/3827274
TLDR: it's an Xcode bug with changing the view to 'compact' width which seems to only affect alignment/positioning. Click on your UILabel inside the cell and go to the inspector all the way to the bottom and play with the 'Installed' or note if the default one is disabled.
来源:https://stackoverflow.com/questions/24371954/static-uitableviewcell-blank-swift-ios-8