I add a PickerView to one of my views in an app, but its size is too small(in height). I find that I cannot drag to make it "longer". How to change its size then?
+1
A:
The only way is by adjusting the pickerView.frame.size.height, but you'll get some pretty bad visual artifacts.
I would think long and hard about attempting to circumvent the established design of this control. If you have so many items or your items are too big for this view, a UITableView is probably what you want to go with. It's far more customizable and can handle items/cells of all different shapes and sizes.
drewh
2009-03-03 14:42:04
Where to add pickerView.frame.size.height=x? I add it in viewDidLoad method, but an error says 'invalid lvalue in assignment'. I initialize the picker view with frame and it is really messed up.
iPhoney
2009-03-04 04:12:20
You can't set pickerView.frame.size.height, you can only set pickerView.frame. Prepopulate a CGRect with the values you want then set pickerView.frame. Again, this is likely not the way to go as you'll get some pretty bad visual artifacts and Apple will probably not let it in the app store.
drewh
2009-03-04 13:57:14