开发者

Android: Lock the Background image but rotate foreground views

开发者 https://www.devze.com 2023-02-07 14:56 出处:网络
I have a Landscape b开发者_如何学Goackground image in place. How do I lock it into position, but allow forground views to be rotated, e.g. a Dialog.

I have a Landscape b开发者_如何学Goackground image in place. How do I lock it into position, but allow forground views to be rotated, e.g. a Dialog.

At the moment, either I lock the orientation so the dialog doesn't rotate, or I don't lock it and the background becomes tiny as I rotate the screen and it fills the narrow width of the screen.


I think your best bet would be to allow the rotation and just display a different background (the original background rotated 90 degrees)

You can catch the rotation in onConfigurationChanged, once you've added android:configChanges="orientation" to your activity in the manifest

0

精彩评论

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