简体   繁体   English

覆盖UIPickerView中突出显示的选择

[英]Overriding highlighted selection in UIPickerView

I have a custom UIPickerView where I use: 我有一个自定义的UIPickerView ,我使用:

-(UIView *)pickerView:(UIPickerView *)pickerView
           viewForRow:(NSInteger)row
         forComponent:(NSInteger)component 
          reusingView:(UIView *)view

to fill the picker with UIView which has two labels. UIView填充选择器, UIView有两个标签。 Is there a way to enable the behavior of highlighting the selected row when touched? 有没有办法在触摸时启用突出显示所选行的行为?

只需在选择器视图的初始化时添加它。

 pickerView.showsSelectionIndicator = YES;

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

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