iOS 列表雜記

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath //行點擊事件spa

 NSIndexPath *path = [self.tableView indexPathForSelectedRow]; //得到被選中的indexPath能夠獲得section,roworm

[self.tableView reloadRowsAtIndexPaths:[self.tableView indexPathsForSelectedRows] withRowAnimation:UITableViewRowAnimationNone]; //刷新table指定行的數據事件

tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; //UITableViewCellSeparatorStyleNone;或者賦值爲NO取消分割線ip

[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; //取消分隔線it

tableView.separatorColor = [UIColor lightGrayColor];//分隔線顏色io

tableView.allowsMultipleSelection = YES;//容許tableView多選table

[_tableView setSectionHeaderHeight:kHeaderHeight];sso

[_tableView setSectionFooterHeight:0];im

 [_tableView setRowHeight:50];數據

self.tableView.backgroundView  優先級高,若是要設置backgroundColor的時候要先把view設置爲nil

self.tableView.backgroundColor = [UIColor redColor];

//在tableView的頭部或者尾部添加view,footerView寬度是不用設置的

       xxxView.bounds = CGRectMake(0,0,0,height);

    self.tableView.tableFooterView =xxxView;

       self.tableView.tableHeaderView =xxxView;

self.tableView.contentInset = UIEdgeInsetsMake(0, 0, xx, 0); //可偏移位置

[cell setAccessoryType:UITableViewCellAccessoryNone]; //設置右側箭頭

相關文章
相關標籤/搜索