標籤:
1 去除分割線
//去除分割線self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
2 高度設定
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [self tableView:tableView cellForRowAtIndexPath:indexPath]; return cell.frame.size.height; //自訂高度// return 110;}
3 自訂Cell,後面會詳細列出如何自訂cell,由於時間關係,這裡暫時給出使用方法,如下:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //MyCell是自己定義的Cell類 MyCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellIdentifier"]; if (!cell) { NSArray *objects = [[NSBundle mainBundle] loadNibNamed:@"MyCell" owner:self options:nil]; for (NSObject *o in objects) { if ([o isKindOfClass:[MyCell class]]) { cell = (MyCell *)o; break; } } } //Configure you cell //... return cell;}
3
IOS 學習筆記 —— tableView 使用詳解(一)