表格在手机应用中是个绝对主力,大多数场景中都会用到。
下面是几个常用的属性定制:
// Cell直接的分割线,包括 // UITableViewCellSeparatorStyleNone, 无分割线 // UITableViewCellSeparatorStyleSingleLine, 单线分割 // UITableViewCellSeparatorStyleSingleLineEtched, 蚀刻风格 self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone // 是否可以选择行 self.tableView.allowsSelection = NO; // 背景色 self.tableView.backgroundColor = [UIColor whiteColor];
滚动到表格最后一行:
NSIndexPath *lastPath = [NSIndexPath indexPathForRow:<The last row number> inSection:0]; [self.tableView scrollToRowAtIndexPath:lastPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];