Gra*_*t M 2 objective-c uitableview
我将tabe视图设置为在IB中使用UITableViewStyleGrouped并且单元格看起来很好,但是部分标题仍然看起来像在UITableViewStylePlain中.它们位于左侧,位置与单元格不匹配,当我在视图中滚动单元格时它们不会滚动.
我用了
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{
return [NSArray arrayWithObjects:@"Cats",@"Area",nil];}
Run Code Online (Sandbox Code Playgroud)
设置章节标题.
干杯,格兰特
尝试实现- (NSString*)tableView:(UITableView*)tableView titleForHeaderInSection:(NSInteger)部分 UIDataSource协议的方法.
该sectionIndexTitlesForTableView:
是你的桌子上的右手侧的指数.
另外,你有没有实现- (UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:UITableViewDelegate的(NSInteger)部分?如果是这样,你可能想尝试没有它.
归档时间: |
|
查看次数: |
6742 次 |
最近记录: |