iphone中的小区选择方式 [英] cell selection style in iphone

查看:113
本文介绍了iphone中的小区选择方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,iphone中有三种选择方式 - 表格视图。

By default there is three selection style in iphone - table view.

灰色 - 蓝色 - 无。

gray - blue - none.

我不需要灰色或蓝色。

我想设置我的自定义。

例如在正常情况下,单元格应具有aaaa.png背景。

For example In normal situation a cell should have "aaaa.png" background.

&选中的单元格应该有bbbbb.png背景。

& Selected cell should have "bbbbb.png" background.

我试图应用cell.backgroundView& cell.selectedBackground视图。但它无法正常工作。

I have tried to apply cell.backgroundView & cell.selectedBackground view. However it isn't working.

如果您对此有任何想法,请帮帮我。

If you have any kind of idea about this, please help me.

先谢谢你的帮助。

推荐答案

这里有三行代码,但你不需要图片!

Three lines of code here, but you don't need an image!

UIView *selectedBackgroundViewForCell = [UIView new];
[selectedBackgroundViewForCell setBackgroundColor:[UIColor redColor]];
theCell.selectedBackgroundView = selectedBackgroundViewForCell;

这篇关于iphone中的小区选择方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆