Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIPickerView with custom views broken in iOS7

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 

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.

Any suggestions?

enter image description here

like image 562
William Jockusch Avatar asked Oct 30 '13 02:10

William Jockusch


1 Answers

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.

like image 72
imihaly Avatar answered Nov 04 '22 12:11

imihaly