简体   繁体   English

UIPickerView中的半透明所选项目

[英]translucent selected item in UIPickerView

I'm looking to add to a UIPicker the translucent grey / blue selection bar. 我希望将透明的灰色/蓝色选择栏添加到UIPicker。 Currently it's not showing up: 目前没有显示:

http://screencast.com/t/XvSqotIPXYJD http://screencast.com/t/XvSqotIPXYJD

Here's a screenshot of the way it should look: 这是它的外观截图:

http://www.screencast.com/users/jeffbubblet/folders/Jing/media/83a7c3d4-3f29-4e03-beb6-cf1118c9d91d http://www.screencast.com/users/jeffbubblet/folders/Jing/media/83a7c3d4-3f29-4e03-beb6-cf1118c9d91d

Right now I'm using the delegate method pickerView:titleForRow:forComponent. 现在,我正在使用委托方法pickerView:titleForRow:forComponent。 I'd prefer not to have to use pickerView:viewForRow:forComponent:reusingView: unnecessarily if it can be avoided. 如果不需要避免,我不想不必要地使用pickerView:viewForRow:forComponent:reusingView:。

I can't seem to find anything in the docs about it, and I'm not looking to customize it one bit - just want the default behavior. 我似乎在文档中找不到关于它的任何内容,而且我也不想对它进行一点自定义-只是想要默认行为。

u would need to set the 您需要设置

@property(nonatomic) BOOL showsSelectionIndicator

of your pickerview 您的pickerview

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM