问题描述
我有一个UIPickerView的问题。
我有9个列表,我创建了一个带有9个按钮的视图。对于每个按钮我已经关联一个标志:当我点击按钮,选择器出现与所选标签相关的列表。
I have a problem with UIPickerView.I have 9 lists and I created a view with 9 buttons. For each button I have associated a flag: when I click a button, a picker appears with the list relating to selected tag.
问题是当选择器出现时,它在背景中,按钮在选择器上方看到。我已经解决了这样的方式:当用户点击一个按钮,其他人都设置为隐藏,选择器看起来不错。
The problem is that when the picker appears, it's in the background and the buttons are seen above the picker. I have solved in this way: when the user clicks a button the others are set as hidden and the picker looks good.
有一个更好的解决方案,前景直接?
There is a better solution to have the picker in the foreground directly?
还可以更改pickerview边缘的颜色,并放置一个不使用长代码的复选框?
One can also change the color of the edges of pickerview and place a check box without using long code?
提前感谢!
推荐答案
您可以使用 .view bringSubviewToFront:pickerview];
,它会带来选择器视图上面的按钮,或者你可以进入 .xib
文件或 storyboard
,并确保选择器视图是视图中添加的最后一个项目。
You can bring the picker view above using [self.view bringSubviewToFront:pickerview];
and it will bring the picker view above the buttons, or you can go in the .xib
file or storyboard
and make sure the picker view is the last item added in the view.
这篇关于UIPickerView前台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!