在iOS7,为什么选中单元格的背景颜色始终是灰色的? [英] In iOS7, why selected cell's background color is always gray?
问题描述
设置 cell.selectionStyle = UITableViewCellSelectionStyleBlue
,甚至是手动设置的蓝色在故事板,但他们都没有工作。
set cell.selectionStyle = UITableViewCellSelectionStyleBlue
, or even manually set Blue in storyboard, but neither of them works.
如果使用 setSelectedBackgroundView:
,它可能工作
但我真的想知道为什么`[细胞setSelectionStyle:]的方法并不适用于iOS 7的工作了吗?是的iOS 7 pcated它去$ P $?如果是这样,为什么打字的时候在X code无任何华林?
But I really want to know why method of `[cell setSelectionStyle:] not work any more in iOS 7? Is it deprecated in iOS 7? If so, why no any waring in Xcode when typing?
推荐答案
的方法不是去precated,它仍然可以工作,可以尝试设置单元格的 selectionStyle
到 UITableViewCellSelectionStyleNone
,例如。在iOS中7,虽然,previous默认 - UITableViewCellSelectionStyleBlue
- 现在看起来像新的默认,即灰色
The method is not deprecated, and it still works—try setting a cell’s selectionStyle
to UITableViewCellSelectionStyleNone
, for instance. In iOS 7, though, the previous default—UITableViewCellSelectionStyleBlue
—now looks like the new default, i.e. gray.
这篇关于在iOS7,为什么选中单元格的背景颜色始终是灰色的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!