Tips
Last active
July 17, 2018 05:04
-
-
Save JeOam/9b23f9539549479e61a3 to your computer and use it in GitHub Desktop.
UITableView Tips
TableView with Index
-(NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{
return self.indexArray;
}
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index
{
return index;
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
return [self.indexArray objectAtIndex:section];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
....
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
设置 tableView 分割线的 SeparatorInset,使得分割线两边不留空隙: