解决UITableViewCell被选中时UILabel的背景颜色变成透明
来源:互联网 发布:淘宝图片尺寸不合法 编辑:程序博客网 时间:2024/05/06 12:16
解决方法是:继承一个新的UILabel
类,重写setBackgroundColor:
方法,让这个方法不能改变Label
的背景颜色.
@interface PersistentBackgroundLabel : UILabel {}- (void)setPersistentBackgroundColor:(UIColor*)color;@end@implementation PersistentBackgroundLabel- (void)setPersistentBackgroundColor:(UIColor*)color { super.backgroundColor = color;}- (void)setBackgroundColor:(UIColor *)color { // do nothing - background color never changes}@end
参考:UITableViewCell makes label's background clear when highlighted
0 0
- 解决UITableViewCell被选中时UILabel的背景颜色变成透明
- 解决UITableViewCell选中状态下UILabel背景消失的问题
- UITableViewCell选中时的背景颜色
- UITableViewCell设置选中背景颜色
- cellForRowAtIndexPath UITableViewCell 选中后的背景颜色设置
- 怎么把桌面图标的名称的背景颜色变成透明
- cell被选中时的背景颜色
- 选中的文字的背景变成别的颜色
- UITableViewCell的选中时的颜色设置
- UITableViewCell的选中时的颜色设置
- UITableViewCell的选中时的颜色设置
- UITableViewCell的选中时的颜色设置
- UITableViewCell的选中时的颜色设置
- UITableViewCell的选中时的颜色设置
- UITableViewCell的选中时的颜色设置
- UITableViewCell的选中时的颜色设置
- UITableViewCell的选中时的颜色设置
- UITableViewCell的选中时的颜色设置
- HDU 1238 Substrings
- PE 372 【类欧几里德】【Stern-Brocot Tree】
- no response after clicking clone in github desktop
- java 学习之三 Formatter的使用,以及文件扩展名的归类
- 一起做面试题--Java多线程交替打印
- 解决UITableViewCell被选中时UILabel的背景颜色变成透明
- Android Studio如何导入开源项目
- CoordinatorLayout +RecyclerView+加载不同布局的item
- 背包问题之1
- 深入理解Java:String
- 日志实时监控+上传
- 前/中/后表达式的转换
- activiti发布流程中文乱码问题
- 在linux(centos)上从源码安装tensorflow