UITableViewCell点击时背景颜色
2015-06-24 10:59
316 查看
1.点击UITableViewCell时,没有点击效果,在cellForRowAtIndexPath:方法中写上
cell.selectionStyle =UITableViewCellSelectionStyleNone;
2.点击UITableCell时,Cell背景颜色不变,但是上面自定义的控件如:UILabel、UIImageView会变颜色
设置UILabel或UIImageView的Highlighted 然后
在cellForRowAtIndexPath:方法中写上
UIView *view_bg =[[[UIView alloc]initWithFrame:cell.frame]autorelease];
view_bg.backgroundColor = [UIColorclearColor];
cell.selectedBackgroundView = view_bg;
3.点击cell行时,背景颜色一闪而过,在didSelectRowAtIndexPath:方法中写上
[tableView deselectRowAtIndexPath:indexPathanimated:NO];
cell.selectionStyle =UITableViewCellSelectionStyleNone;
2.点击UITableCell时,Cell背景颜色不变,但是上面自定义的控件如:UILabel、UIImageView会变颜色
设置UILabel或UIImageView的Highlighted 然后
在cellForRowAtIndexPath:方法中写上
UIView *view_bg =[[[UIView alloc]initWithFrame:cell.frame]autorelease];
view_bg.backgroundColor = [UIColorclearColor];
cell.selectedBackgroundView = view_bg;
3.点击cell行时,背景颜色一闪而过,在didSelectRowAtIndexPath:方法中写上
[tableView deselectRowAtIndexPath:indexPathanimated:NO];
相关文章推荐
- 单据UI界面设计开发
- UITable里的分割线
- SharePoint 2013 引发类型为“System.ArgumentException”的异常。 参数名: encodedValue
- iOS 9: UIStackView入门
- 如何让UILabel显示多行,并在结尾显示省略号
- (转载)UIKIt力学教程
- Builder模式
- SQL Server 中master..spt_values的应用
- master.dbo.spt_values
- [Groovy]获取当前活动的Environment,获取response中节点的name和节点的value
- execute、executeQuery和executeUpdate之间的区别
- 【我们都爱Paul Hegarty】斯坦福IOS8公开课个人笔记35 UITextField文本框
- What components are not suitable to work as component interfaces
- Devexpress VCL Build v2015 vol 15.1.2发布
- UIModalPresentationStyle和UIModalTransitionStyle
- 用block将UIAlertView与UIActionSheet统一起来
- Android 使用正则表达式来快速生成多套dpi及分分辨率适配的UI
- UIControl
- 10 DelayQueue 延时队列类——Live555源码阅读(一)基本组件类
- UIButton 设置圆角 边框颜色 点击回调方法 &&图片在右文字在左