setOrientation problem

☆樱花仙子☆ 提交于 2019-12-04 19:58:38

Just to note: Apple started using a static (maybe even dynamic) analyzer and blocks apps that use private methods (e.g. setOrientation:) from entering the store. Happened to a friend of mine last week.

Have you tried building against iPhone OS 3.0 and relying only on shouldRotateToInterfaceOrientation:? The behaviour seems to be fixed (compared to the implementation in 2.x) and - at least for me - does the job.

Typically you wouldn't support the upside down orientation. That seems to be the standard Apple app behavior and makes sense. The upside down case is not really useful and can cause confusion to the user.

We had a similar problem where subviews would migrate up and down the main view when flipping through the upside down case. We just stopped supporting upside down and that basically solved the problem.

Epsilon Prime

The way to avoid the rotation bug when rotating from upside down to portrait is not to do it. Instead, rotate twice stopping halfway (say UIDeviceOrientationLandscapeRight). The question of timing is not to use sleep but instead implement didRotateFromInterfaceOrientation and fire the second rotation (or push to next view) at that point.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!