У меня есть код Tableview вроде этого:Tableview раздел заголовка
мой файл tableview.m:
@implementation RevealTableViewController {
NSArray *menuItems;
}
- (void)viewDidLoad {
[super viewDidLoad];
menuItems = @[@"CART", @"WISHLIST", @"LOGIN", @"REGISTER", @"NEW ARRIVALS", @"BRANDS", @"CLOTHING", @"ACCESSORIES", @"SHOES",@"CATEGORY 6", @"CATEGORY 7",@"CATEGORY 8",@"CATEGORY 9"];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return menuItems.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *CellIdentifier = [menuItems objectAtIndex:indexPath.row];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) {
[tableView setSeparatorInset:UIEdgeInsetsZero];
}
if ([tableView respondsToSelector:@selector(setLayoutMargins:)]) {
[tableView setLayoutMargins:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
return cell;
}
Я знаю, как сделать заголовок раздела по titleForHeaderInSection метода в первой строке, но если Я просто хочу сгруппировать форму tableview @ "NEW ARRIVALS" на @ "CATEGORY 9"? Как я могу сделать?
S ee, если это [http://stackoverflow.com/questions/18822619/ios-7-tableview-like-in-settings-app-on-ipad][1] помогает вам. [1]: http://stackoverflow.com/questions/18822619/ios-7-tableview-like-in-settings-app-on-ipad – swapnilagarwal