开发者

Rotate of 90 degrees a Dialog / AlertDialog created by the system?

开发者 https://www.devze.com 2023-01-20 09:40 出处:网络
Does it exists a way to apply a rotation (of 90 degrees) to an AlertDialog that has been created by the system?

Does it exists a way to apply a rotation (of 90 degrees) to an AlertDialog that has been created by the system?

This could seem tricky at first sight. My application uses the camera in preview and must work in landscape AND in portrait, starting from Android 1.5.

However, when the OS automatically manages the phone orientation, the previewed image is not displayed in the same way on all phones! (I have tested with an Android Dev Phone 1 = G1, a HTC Desire and a Samsung Galaxy). When I fixed the issue on the G1, the issue occurs on the Desire....

The only way to fix it on all phones consists in forcing the application to stay in landscape (android:screenOrientation="landscape" in the AndroidManifest.xml) and to manage to apply a rotation of 90° to each displayed element so that the UI will be in portrait from the user point of view.

However, system dialogs must also undergo a rotation.

So my question is : is it possible to change the orientation of an AlertDialog created by the system, maybe using a tr开发者_开发技巧icky way ?

If not, I know how to do it using a custom layout, but I will lose the system style.

0

精彩评论

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

关注公众号