开发者

Orientation Change not Grabbing Correct layout

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜