Reputation: 5298
I have a UITableView
which occupies the entire screen, besides a navigation bar.
The UINavigationItem
has a UIBarButtonItem
that shows a previously hidden UIPickerView
when tapped.
I'm trying to resize the UITableView
so that it occupies the rest of the screen not used by the now visible UIPickerView
.
I know the framework already does something like this, when focusing a text field, it resizes the entire app's view and pops up the keyboard at the bottom.
What's the best way to do this?
I'd just like to make sure I'm not doing it wrong :)
Upvotes: 0
Views: 907
Reputation: 243146
You can alter the dimensions of a view by changing that view's frame
property. The frame consists of two structs: a point indicating the origin (TL corner) of the view, and a size indicating its width and height. Simply create a new CGRect, assign it to your view's frame
property, and you'll have dynamically resized your view.
Upvotes: 1