iOS当UITableViewCell被选中或者高亮的时候,它的所有子view的颜色都会改变
来源:互联网 发布:mac团灭 编辑:程序博客网 时间:2024/05/17 21:50
UITableViewCell changes the background color of all sub views when cell is selected or highlighted.
意思就是说当UITableViewCell被选中或者高亮的时候,它的所有子view的颜色都会改变。
如果你不喜欢让它变透明,你可以在你的自定义UITableViewCell里重写这两个方法:
假设那个view叫redline,它的颜色为红色。
// CustomTableViewCell.h
@interface CustomTableViewCell : UITableViewCell
@property (strong, nonatomic) UIView *redline;
@end
// CustomTableViewCell.h
@implementation CustomTableViewCell
-(void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {
[super setHighlighted:highlighted animated:animated];
self.redline.backgroundColor = [UIColor redColor];
}
-(void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
self.redline.backgroundColor = [UIColor redColor];
}
@end
意思就是说当UITableViewCell被选中或者高亮的时候,它的所有子view的颜色都会改变。
如果你不喜欢让它变透明,你可以在你的自定义UITableViewCell里重写这两个方法:
假设那个view叫redline,它的颜色为红色。
// CustomTableViewCell.h
@interface CustomTableViewCell : UITableViewCell
@property (strong, nonatomic) UIView *redline;
@end
// CustomTableViewCell.h
@implementation CustomTableViewCell
-(void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {
[super setHighlighted:highlighted animated:animated];
self.redline.backgroundColor = [UIColor redColor];
}
-(void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
self.redline.backgroundColor = [UIColor redColor];
}
@end
0 0
- iOS当UITableViewCell被选中或者高亮的时候,它的所有子view的颜色都会改变
- iOS当UITableViewCell被选中或者高亮的时候,它的所有子view的颜色都会改变
- 当cell 被选中的时候,cell内部的所有的子控件都会达到高亮状态
- 设置UITableViewCell的选中高亮颜色
- UITableviewCell 改变选中selectedBackgroundView 的大小 颜色
- iOS UITableViewCell选中后的颜色设置
- 设置UITableViewCell选中的颜色
- 设置UITableViewCell选中的颜色
- 设置UITableViewCell选中的颜色
- UITableViewCell的选中颜色修改
- 当UITableViewCell被选中时,上面的自定义view消失的问题
- eclipse选中一个单词,其他相同的单词都会高亮显示的颜色修改
- eclipse选中一个单词,其他相同的单词都会高亮显示的颜色修改
- UITableViewCell的高亮和选中状态
- UITableViewCell的高亮和选中状态
- IOS UITableViewCell的选中时的颜色设置
- iOS开发之UITableViewCell的选中时的颜色设置
- iOS开发UITableViewCell的选中时的颜色设置
- 两个整数值的交互
- java.lang.IllegalArgumentException: Service Intent must be explicit: Intent {
- 模板变量详解
- 模板中的语法知识
- Android 基于google Zxing实现二维码、条形码扫描,仿微信二维码扫描效果
- iOS当UITableViewCell被选中或者高亮的时候,它的所有子view的颜色都会改变
- 模板的使用技巧
- 我的Java后端书架 (2016年暮春3.0版)
- iOS多线程开发——GCD的使用与多线程开发浅析
- 控制器的模块和操作
- Android 百度地图sdk 标注图marker中可以切换显示不同内容
- URL
- 分组、页面跳转与ajax
- 九、Go语言库之strconv包--GO语言笔记