在xib中创建自定义表格视图
答
创建一个UITableViewCell子类与厦门国际银行文件,然后将细胞加载到您的tableView,
- (void)viewDidLoad {
[super viewDidLoad];
UINib* nib = [UINib nibWithNibName:@"YourTableViewCellName" bundle:nil];
[self.tableView registerNib:nib forCellReuseIdentifier:@"Cell"];
}
然后在你的cellForRowAtIndexPath方法,
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
YourTableViewCellName *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
return cell;
}
希望这将有助于您。
你有没有尝试过这样的事情? [self.tableView registerNib:@“MyTableViewCell”forCellReuseIdentifier:@“my_cell”]; –