开发者

Orientation Change not Grabbing Correct layout

开发者 https://www.devze.com 2023-01-27 21:29 出处:网络
I have two layout files, one for landscape (layout-land) and one for portrait (layout-port).When I run my application the correct layout is grabbed initially dependent upon how I am holding my phone.

I have two layout files, one for landscape (layout-land) and one for portrait (layout-port). When I run my application the correct layout is grabbed initially dependent upon how I am holding my phone. If I am holding landscape, landscape is grabbed and visa versa. BUT, once I initially launch my application, if I change orientation the first layout grabbed at launch is used when switching orientation.

How do I get Android to changed layout xml per orientation change after initial launch of applicaiton?

In my manifest I have android:configChanges="orientation/key开发者_JS百科boardHidden"


When you specify configChanges in the manifest for an activity, the activity has to handle the events by itself. Either do the required layout change in the activity or remove the configChanges in the manifest.

http://developer.android.com/guide/topics/manifest/activity-element.html#config

0

精彩评论

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

关注公众号