iOS 自定义UITableViewCell的分割线
2016-07-19 11:19
435 查看
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
CGContextFillRect(context, rect);
//上分割线,
CGContextSetStrokeColorWithColor(context,SET_COLOR(225,225,
225).CGColor);
CGContextStrokeRect(context, CGRectMake(0, -0.5, rect.size.width,0.5));
//下分割线
CGContextSetStrokeColorWithColor(context, SET_COLOR(225,225,
225).CGColor);
CGContextStrokeRect(context, CGRectMake(0, rect.size.height, rect.size.width,0.5));
}
这是一个方法,直接在继承与UItableViewCell的类中声明,就可以了,,简单明了
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
CGContextFillRect(context, rect);
//上分割线,
CGContextSetStrokeColorWithColor(context,SET_COLOR(225,225,
225).CGColor);
CGContextStrokeRect(context, CGRectMake(0, -0.5, rect.size.width,0.5));
//下分割线
CGContextSetStrokeColorWithColor(context, SET_COLOR(225,225,
225).CGColor);
CGContextStrokeRect(context, CGRectMake(0, rect.size.height, rect.size.width,0.5));
}
这是一个方法,直接在继承与UItableViewCell的类中声明,就可以了,,简单明了
相关文章推荐
- dfs常见的配置文件中的value与description
- java.io.NotSerializableException: com.jshb.fengyun.wms.ui.secsystem.model.User$PlatsBean
- JDBC中execute、executeQuery和executeUpdate的小结
- android-BluetoothDevice
- UIButton实现左文字右图片
- iOS开发从入门到精通--开关按钮UISwitch控件
- Android studio value 2 (com.android.dex.DexException:资源重复引用或者加载问题)
- iOS开发runtime给工程所有UITextfield属性赋初值
- [转]java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x8E' for column 'nick' at row 1
- 基于java容器注解说明---@Value和@ImportResource
- servlet request getHeader(“x-forwarded-for”) 获取真实IP
- [SQL优化工具]Quest.Central.For.Databases——SQL Tuning for SQL Server
- EL表达式从request和session中取值
- android中requestFocus
- android-UUID
- SpannableString与SpannableStringBuilder使用
- EasyUI中在表单提交之前进行验证
- ZZULUI-1183平面点排序(一)(结构体专题)
- requestAnimationFrame代替setTimeout
- NV Oblique Frustum Clipping demo