tableview 自定义cell左边图片
来源:互联网 发布:淘宝链接转化微信 编辑:程序博客网 时间:2024/04/29 03:28
static NSString *cellIdentifier = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
// Configure the cell...
if([self.dataArray count] == 0) {
return cell;
}
if(cell == nil) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
CGFloat x = 15.0f;
CGFloat image_width = 30.0f;
CGFloat y = (45.0f - image_width) /2.0f;
UIImageView *imageViews = [[UIImageView alloc] initWithFrame:CGRectMake(x, y, image_width, image_width)];
imageViews.tag = 1945;
imageViews.backgroundColor = [UIColor clearColor];
imageViews.layer.masksToBounds = YES;
imageViews.layer.cornerRadius = image_width / 2.0f;
[cell addSubview:imageViews];
// 文字缩进 (indentationLevel * indentationWidth)
cell.indentationLevel = 3;//缩进层级 默认0
cell.indentationWidth = (image_width + x) / 3.0f;//每次缩进寛 默认10
}
0 0
- tableview 自定义cell左边图片
- tableView自定义cell
- 自定义tableview cell
- iOS tableview自定义cell
- iOS开发中tableview中cell图片自定义方法。
- TableView里面的cell根据图片或者文字自定义高度
- UIKit-TableView--TableView用代码自定义cell
- TableView中实现自定义cell
- 自定义TableView 继承, cell, model
- Objective-C tableView自定义cell
- IOS swift 自定义Tableview cell
- UI - TableView高级(自定义cell、cell自定义高度)
- 自定义tableView cell的删除按钮
- 【iOS开发TableView】TabelView自定义cell
- tableView 自定义Cell,仿收藏界面
- iOS tableview cell 中自定义lable
- tableView - 自定义等高cell-storyBoard方式
- tableView - 自定义等高cell-xib方式
- 写给程序员的最好的13条建议
- 高德地图poi全国搜索
- 进程的同步与通信,进程与线程同步的区别,进程与线程通信的区别
- openstack ERROR neutron.common.config [-] Unable to load neutron from configuration file /usr/shar
- 正则口诀
- tableview 自定义cell左边图片
- Java中内存泄漏的情况
- imageView图片动态改变背景图
- 学习Linux系统中命令的简单方法
- Java设计模式六大原则之场景应用分析
- js逻辑操作符(!,&&,||)与运算符优先级
- spring boot 集成swagger
- [BZOJ4259]残缺的字符串(FFT)
- HAUT 1261 地狱飞龙(数值积分)(河南工业大学2017校赛)