I'm trying to change PickerView's height
self.pickerView = [[UIPickerView alloc] init];
self.pickerView.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
Xcode log shows the following message:
-[UIPickerView setFrame:]: invalid height value 274.0 pinned to 216.0
How can I change its height?
There are only three valid values 162.0, 180.0 and 216.0 for height of the UIPicker. even if you set different height it will set the height to the one of the these three heights which is nearest to your given height.
Try like this. I also googled so many examples and found this one.
here are only
three
valid
heights
forUIPickerView
(162.0, 180.0 and 216.0)
.You can use the
CGAffineTransformMakeTranslation
andCGAffineTransformMakeScale
functions to properly fit the picker to your convenience.Example:
The above code
change
theheight
ofpicker
view to half
andre-position
it to the exact(Left-x1, Top-y1)
position.Refer more here.
There are only three valid heights for
UIPickerView (162.0, 180.0 and 216.0)
.More detail.