As far as I know, it will be messed up if you shrink it.
a) UITableView + UIPickerView
I recommend you use the "a row in UITableView + UIPickerView" to do this. You can use a row in tableView like the dropDownList in Windows, when you tap on this row will show the pickerView (hidden at first).
b)
If you have a long lists of data in tableView and only one of the items needs to pick data, you should scroll the view using the following method (make sure to calculate the orginal position of pickerView as it will be moved up/down together):
-(void)setViewMove:(BOOL)moveUP offset:(CGFloat)offset
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
CGRect rect = self.view.frame;
if(moveUP)
{
rect.origin.y-=offset;
rect.size.height+=offset;
}
else //move down
{
rect.origin.y+=offset;
rect.size.height-=offset;
}
self.view.frame = rect;
[UIView commitAnimations];
}
c)
You can also add another view for the picker and go back to this view when you have selected something.
My conclusion is:
If you have only few lines in tableView, use a.
If you have lots of lines in tableView but only one of them needs picker, use b.
If you have lots of lines in tableView and lots of them need picker, use c.