Sop*_*ert 3 iphone cocoa-touch uitableview iphone-sdk-3.0
如果我有一个自定义UITableViewCell不使用textLabel单元格的内置而是自己的绘图,我如何更改选择的外观contentView,就像它自动为默认文本(可通过设置自定义selectedTextColor:)?
如果我改变了tableView:willSelectRowAtIndexPath:,那么它只会在蓝色选择背景启动后更新,但不会在它动画时更新,就像我想要的那样.
在tableview cellForRowAtIndexPath方法中添加此代码,只需更改UITableViewCell选择样式的预期颜色.
//-------------------------------------------------------------------------
//background selected view
UIView *viwSelectedBackgroundView=[[UIView alloc]init];
viwSelectedBackgroundView.backgroundColor=[UIColor colorWithRed:124.0/255.0 green:202.0/255.0 blue:227.0/255.0 alpha:1.0];
cell.selectedBackgroundView=viwSelectedBackgroundView;
//-------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12691 次 |
| 最近记录: |