Re: IOS force hidden tab to adjust subviews after rotation
Re: IOS force hidden tab to adjust subviews after rotation
- Subject: Re: IOS force hidden tab to adjust subviews after rotation
- From: Kyle Sluder <email@hidden>
- Date: Thu, 01 Aug 2013 10:30:59 -0700
On Aug 1, 2013, at 10:23 AM, Trygve Inda <email@hidden> wrote:
>> On Thu, Aug 1, 2013, at 08:48 AM, Trygve Inda wrote:
>>> In my iOS app with two tabs, after the device is rotated, is there a way
>>> to
>>> force the hidden tab to re-layout its subviews BEFORE clicking that tab
>>> to
>>> make it visible?
>>>
>>> One of my tabs uses an image from another tab and I need it to adjust its
>>> frame rect.
>>
>> Why does "using an image from another tab" involve adjusting its frame
>> rect? UIImages don't have frames.
>>
>> --Kyle Sluder
>
> Tab one has a ScrollView that has struts and springs to maintain full screen
> size. This scrollview has three UIViews that together fill up more than one
> screen (thus the scrollview).
>
> Tab 2 needs a full-screen background image that is a darkened version of the
> current position and view of the scroillview in tab 1.
>
> If I have tab 2 selected and rotate the device, I need tab 1 to reconfigure
> its views so that I can grab a "snapshot" of the scrollview in tab 1.
>
> As it is now, tab one will not resize itself until it is selected.
>
> If I can't figure this out, I'll have to put a similar scrollview in tab 2
> that is just a copy of the one in tab 1, but that is less than ideal.
A couple things come to mind:
1. Make Tab 2's view controller a custom view controller container whose sole purpose is to host another view controller that contains the real guts of Tab 2. Toggling between tabs would move that GutsViewController between the tabs.
2. Perhaps use a naked UITabBar instead of a UITabBarController, and convert Tab 1's view controller into an overlay that you add and remove based on the tab bar delegate messages.
Both of these approaches have the benefit of not allocating a screen-sized bitmap of your hidden tab's contents.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden