开发者

Is it possible force UI autorotation in iOS?

开发者 https://www.devze.com 2023-02-23 22:54 出处:网络
I have an auto-rotating view which should be only horizontal at some specific time. I tried changing return value of -shouldAutorotateToInterfaceOrientation: for specific time, but it didn\'t work as

I have an auto-rotating view which should be only horizontal at some specific time. I tried changing return value of -shouldAutorotateToInterfaceOrientation: for specific time, but it didn't work as I expected. Because there is no way to force currently vertical oriented UI to horizontal. Is this possib开发者_如何学JAVAle...?


I made a conclusion there is no such thing. I decided to implement rotation manually, myself instead of autorotation. I didn't believed this is possible, but I realized I can do exact things with UIDeviceOrientationDidChangeNotification.

There is -[UIApplication statusBarOrientation] property which looks forces rotation of UI in simulator, but it's just rotating status bar only. However, that's important and preferred for basis for UI orientation by the simulator.

I used it and now rotate everything manually. this is more easier to make and manage.

0

精彩评论

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

关注公众号