开发者

Rotation of ViewController in TabbarController

I have a custom UIViewController in a UITabbarCont开发者_开发技巧roller and want to respond to rotation events. When a rotation occurs, the tabbarcontroller and the viewcontroller get rotated. However, the view in the viewcontroller doesn't get redrawn properly: the layout doesn't autoresize and it is black on parts of the screen.

The strange thing is that it works when I go to another tab and the back again to my original viewcontroller.

What could possibly be wrong? I checked that didRotateFromInterfaceOrientation:fromInterfaceOrientation is being called. However, the view.frame.size values are still the old ones from before the rotation. That's probably not correct.


Got it!

    self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜