开发者

iPhone app autorotates on one device, but not another

开发者 https://www.devze.com 2023-02-09 02:38 出处:网络
Does anyone know of a reason why an iPhone would autorotate on one device, but not another? I can\'t reproduce it on my iPhone, iPod Touch, or any of the simulator devices.

Does anyone know of a reason why an iPhone would autorotate on one device, but not another? I can't reproduce it on my iPhone, iPod Touch, or any of the simulator devices.

Are there any device settings I should be paying attention to? The offending iPhone has the same SDK v开发者_如何学JAVAersion installed (4.2.1), but is a different model (MC319LL) than mine (MC605DN).


Well, I never figured out why the two phones were acting differently, but this bit of code in in the UITabBarController subclass seems to have solved things:

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


You made sure that the misbehaving device had its rotation lock turned off in the settings, right?

0

精彩评论

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