开发者

Statusbar orientation changes after dismissing modal view

开发者 https://www.devze.com 2022-12-19 07:25 出处:网络
My statusbar orientation is landscape, I have a cocos2d view that only supports portrait orientation(it is OK since it handles transformations). I have another view that is presented as a modal by coc

My statusbar orientation is landscape, I have a cocos2d view that only supports portrait orientation(it is OK since it handles transformations). I have another view that is presented as a modal by cocos2d controller, its orientation is landscape, but whenever I dismiss it, my statusbar orientation somehow changes to portrait, I tried overriding supported orientation methods of container views, but none of them has an开发者_如何学Goy effect.

regards


OK, here is how I did it, I thought what messes things up is the fact that orientation of container being different from the view that is presented as modal. So I added another view to contain cocos2d view and presented the modal using that view. The container's orientation is lanscape, so I needed to transform cocos2d view int he load method of its controller.

self.view.transform = CGAffineTransformRotate(self.view.transform, -(M_PI / 2.0));
self.view.frame = CGRectMake(0, 0, 480, 320);

I am still looking for a better way of doing this.

0

精彩评论

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

关注公众号