开发者

UIStatusbar changes orientation, but everything else stays the same

开发者 https://www.devze.com 2023-03-05 19:41 出处:网络
I have a tabbar app, with some uinavigationcontrollers. In every VC i have: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

I have a tabbar app, with some uinavigationcontrollers.

In every VC i have:

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

But for some reason when rotating the screen the status bar rotates, but开发者_StackOverflow社区 the rest of my view stays the same. How can I fix this?


Try adding this to your info.plist

UIStatusbar changes orientation, but everything else stays the same


shouldAutorotateToInterfaceOrientation: would normally be implemented like this (for an iPhone app that supports rotation):

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

It's not clear from your question whether you want the subviews to rotate or the status bar to not rotate.

0

精彩评论

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

关注公众号