7

我正在使用故事板。虽然静态表格视图出现在故事​​板中,但在模拟器上运行后它不会出现。更准确地说,仅显示部分标题。如果我将样式更改为动态,则会出现表格视图!

4

1 回答 1

6

可能有2个可能的原因。

首先,您没有在情节提要中使用 UITableViewController,即您在 UIViewController 中有一个 UITableView。如果你想使用静态单元格,我很确定你必须使用 UITableViewController。

其次,您已经正确地实例化了 UITableView,但您已经在 UITableView 的委托中实现了编程控制功能。具体来说,这些功能至少包括:

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

如果两者都不是,那么我认为您需要提供更多信息。

于 2013-10-09T05:55:36.847 回答