Re: [iPhone] UIButton and Device Orientation problem in MainWindow.
Re: [iPhone] UIButton and Device Orientation problem in MainWindow.
- Subject: Re: [iPhone] UIButton and Device Orientation problem in MainWindow.
- From: Sandro Noël <email@hidden>
- Date: Thu, 28 Oct 2010 16:14:07 -0400
Matt that worked out perfectly!
instead of
[self.window addSubview:pButton];
changed it to
[self.tabBarController.view addSubview:pButton];
Coordinates and orientation are now right in the spot ... thank you !!!
Sandro.
On 2010-10-28, at 3:54 PM, Matt Neuburg wrote:
> On Thu, 28 Oct 2010 14:10:28 -0400, Sandro No?l <email@hidden> said:
> >Greetings.
> >
> >I am trying to draw a UIButton in the application's main window so the
> >button remains visible no matter what the user does in the sub view's.
> >(TabBar based with a bunch of NavBars.)...
> >
> >This works great in the default device orientation.
> >
> >But left, right and upside down, the orientation of the button remains as if it was upright.
> >I've tried adjusting the coordinates but the image drawn inside the button does not change orientation.
> >when the phone is upside down, the image is upside down but the rest of the interface is well positioned.
> >
> >I'm sure the trick is simple but I can't seem to find it in google, or i'm not using the right therms.
> >can someone point me in the right direction ? please :)
> >
>
> It's not a trick. You simply mustn't put the button in the window; it must go into the root view, the sole subview of the window, which is placed there and managed by a UIViewController. Start your app with the UIView-based App template and work from there, building your interface in the secondary nib. Read up on view controllers in the docs, which are excellent on this point. You may have to unwind the whole way your interface is constructed in order to do this, so start with just the button and add stuff back after you get that working. m.
>
> --
> matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
> A fool + a tool + an autorelease pool = cool!
> AppleScript: the Definitive Guide - Second Edition!
> http://www.apeth.net/matt/default.html#applescriptthings
_______________________________________________
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