How to fit the application for both config like portrait,landscape in android?

半世苍凉 提交于 2019-12-02 17:50:49

问题


I have done my application in portrait configuration. When I load my application in device its coming portraint configuration. But in landscape mode i keep missing some controls. How can I fix the screen for both configurations?


回答1:


You probably have to define different layouts for landscape and portrait. You could force android to choose the proper layout depending on orientation. You could put landscape layout xml files in “res\layout-land” and portrait in “res\layout”. Of course it’s always good idea to use RelativeLayout, but it depends on your application. Regards!




回答2:


This question was asked before: here

If you are a beginner, you might find the following useful(read up): Developing orientation aware Android apps




回答3:


Check this out. Google has released a tutorial about this recently: https://developer.android.com/resources/samples/MultiResolution/index.html



来源:https://stackoverflow.com/questions/2012332/how-to-fit-the-application-for-both-config-like-portrait-landscape-in-android

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