1.不知道你有沒(méi)有注意到cell的分割線和視圖左邊是有一定距離的,對(duì)的,這是屬性是可以設(shè)置的:
mTableView.separatorInset=UIEdgeInsetsMake(0, 0, 0, 0);
2.有時(shí)候我們并不希望tableview有彈跳效果
mTableView.bounces=NO;
3.如果我希望tableview看起來(lái)更像一個(gè)模塊怎么辦了?當(dāng)然是給他打上邊框
mTableView.layer.borderWidth=1;
4.我不想沒(méi)有內(nèi)容的cell也顯示出來(lái)
[mTableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
有些屬性或方法我們是不常用,但用好了也會(huì)讓你的視圖與眾不同
//頭寬
- (CGFloat)tableView: (UITableView *)tableView
heightForHeaderInSection: (NSInteger)section
{
return 0;
}
//腳寬
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 0;
}
//頭視圖
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
return nil;
}
//視圖
-(UIView*) tableView: (UITableView*)tableView
viewForFooterInSection: (NSInteger)section
{
return nil;
}