Question

NEW EDIT:

I have narrowed my problem to this - i have a view that i add to my main view. That view is nib file in portrait orientation. That view can be added both in landscape or portrait mode. After adding it as subview how do i tell it, device is now in landscape mode, you should autoresize to fit?

OLD: /* I have a view, that is loaded via [NSBundle mainBundle] loadNibNamed. When button show is pressed view should show, and likewise when button hide is pressed view should hide. And this works ok.

Problem is with when device orientation is changed (lets say from portrait to landscape mode). If view is shown it resizes ok, and everything works fine. But if view is hidden, and i rotate the device and press show, view is shown, but not adjusted to new layout. It retains its original dimensions.

It is as automatic resizing is only applied to visible components. Is there some way to force resizing of the view? */

Was it helpful?

Solution

When you add your view, use the following:

[subViewFromNib setBounds:[viewYouAddedSubviewTo bounds]];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top