0

So, I've laid out a UITableViewController with two prototype cells, and a view in the TableView's header area. In the header area, there are two views that each hold an icon and a label, Friends and Groups.

It looks all good in the Storyboard Editor, but when the screen actually loads, the images and labels in question are gone. I'm fairly new to iOS, so I haven't run into this before. Here are a couple screen shots to illustrate:

In the storyboard editor:

On the simulator:

Any thoughts? Thanks in advance for your help.

4

2 回答 2

0

You've implemented the data source methods in your view controller, correct?

If not, UITableView will call a method that its data source implements: tableView:cellForRowAtIndexPath: from the UITableViewDataSource protocol, where you would return the cell to use, in this case the cell with the Identifier that you specified in your Storyboard.

于 2012-12-01T00:17:56.897 回答
0

我们发现这是因为 UITableView 的 tableHeaderView 在更新/重绘方面真的很奇怪。很难让它以任何预期的行为行事。

我们没有使用 UIImageViews,而是使用了 UIButtons。这些按钮似乎知道如何以及何时更新和重绘自己,所以这很有效。

于 2012-12-12T22:51:36.433 回答