landscape layout does not change on orientation change and portain layout does not change in orientation change

心已入冬 提交于 2019-12-23 02:45:15

问题


i have two layouts here one is portrait and one is landscape the landscape is located in the layout-land folder and the the portrait is located in the layout folder both have the same name. what i want to do here is that when the emulator screen is portrait it will load portrait and when the screen is landscape it will load a landscape layout but it is not happening when the first view is portrait and when i change orientation it still loads the portrait layout in landscape view and when its landscape first and i change orientation to portrait it loads the landscape layout on portrait screen what seems to be the problem here.

portrait code: http://pastebin.com/QSVL2MHf
landscape code: http://pastebin.com/ktGAe0QX


回答1:


Remove android:configChanges="orientation" in your AndroidManifest.xml section for this particular Activity.



来源:https://stackoverflow.com/questions/21977707/landscape-layout-does-not-change-on-orientation-change-and-portain-layout-does-n

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