博客>
ios加载自定义cell的xib文件
ios加载自定义cell的xib文件
ios
UITableView
UITableViewCell
加载xib方法
版权声明:本文为博主原创文章,未经博主授权不得转载。
加载cell的xib文件
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
FindTableViewCell *cell;
if (!cell) {
[tableView registerNib:[UINib nibWithNibName:@"FindTableViewCell" bundle:nil] forCellReuseIdentifier:@"cell_a"];
cell = [tableView dequeueReusableCellWithIdentifier:@"cell_a" forIndexPath:indexPath];
if (APPScreenWidth==320) {
cell.PreferenceL.constant=10;
cell.SubW.constant=150;
}
// 取消选中状态
cell.selectionStyle=UITableViewCellSelectionStyleNone;
// 取消分割线
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
return cell;
}
收藏