问题描述
我有一个带有UIPickerView的应用程序。我正在使用方法返回自定义视图
I have an app with a UIPickerView. I am returning a custom view with the method
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
它在iOS 6中看起来很好。在iOS 7中,没有那么多 - 下面的屏幕截图。
It looked fine in iOS 6. In iOS 7, not so much -- screen shot below.
请注意,在没有焦点的单元格中,第二列和第三列重叠。中心行是正确的。
Notice that in the cells that don't have focus, the second and third columns overlap. The central row is correct.
有任何建议吗?
推荐答案
这似乎是为了一个奇怪的原因是,如果任何列的宽度高于拾取器视图宽度的1/3,则布局会中断。因此,如果你有一个320像素宽的选择器视图106或更少工作,但107或更高是错误的,无论你有2,3,4 ...组件。真奇怪。
It seems that for a strange reason, if the width of any column is higher than 1/3 of the picker view's width the layout breaks. So if you have a 320 pixel wide picker view 106 or less is working, but 107 or higher is wrong, regardless if you have 2,3,4 ... components. Really strange.
这篇关于UIPickerView在iOS7中打破了自定义视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!