views:

966

answers:

3

i have problem with autorotate on iphone

i set up in all classes

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

but it is not respond ;/

Sample code is: http://b6.s3.p.quickshareit.com/files/testautorotatecb367.zip

problem is only with first tab, if i switch application to second tab, and rotate iphone, interface is rotating. it is not rotating in TAB1, where i put custom UINavigationController

A: 

And your custom UINavigationController also has the same

shouldAutorotateToInterfaceOrientation

method that returns YES to landscape views?

Kendall Helmstetter Gelner
A: 

Okay, i think i see what the problem is in you code. You need to add your UINavigationBar to the delegate like you did with the tab bar, otherwise it doesn't know of its existence and therefore it isn't rotating because it is confused on what is in the view.

Because I use Interface Builder to take care of all my GUI needs, i'm not sure how to do this manually in code, so, to help you out, here >> http://www.radford.edu/ebalci/Tutorials/SimpleTabNavTemplate.zip is a tutorial kind of thing i made a few days ago for a friend, you can use it as sort of a template or guide to help you out (i hope it will help you)

[my tutorial uses UItableViews for navigation but that is optional]

also, i commented out my rotation methods because i wasn't worried about it at the time, but if you uncomment them (and i think you have to add the method to one of the classes because i deleted it) it will rotate, i just checked, but was too lazy to re zip it and upload it.

I just want you to know that I pretty much just made this thing a day ago, there is a rich text file in the zip that has instructions, but, it is a rough draft, i haven't really revised it yet so, i hope you can read through it with ease despite the fact it is a rough draft.

Let me know if it helps =) Good Luck

Wolfcow
+1  A: 

OK

problem is that i do not init navigation views, i use only alloc, after i add alloc] init] all started works OK