开发者

tabbar based application won't rotate at all

开发者 https://www.devze.com 2023-03-26 20:35 出处:网络
My tab bar based application won\'t rotate at all. I\'ve done all the configuration needed without luck. All my controllers override the:

My tab bar based application won't rotate at all. I've done all the configuration needed without luck. All my controllers override the:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return YES;
}

and in the viewDidLoad method i have set the properties:

self.view.autoresizesSubviews = YES;
    self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth;

Now i noticed that the shouldAutorotate method is called only once when the view is created the first time, i guess it should be like that. All of my controllers are subclassing UIViewController

I don't know what else to do. Some help will be开发者_开发问答 appreciated.

Thanks.


try this one

u have to use this all of ur Viewcontrollers in tabbarcontroller.

change this

UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth;

to

UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

self.view.autoresizesSubviews = YES;

self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
0

精彩评论

暂无评论...
验证码 换一张
取 消