How to fit the application for both config like po

2019-03-06 13:50发布

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?

3条回答
Animai°情兽
2楼-- · 2019-03-06 14:22

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!

查看更多
甜甜的少女心
3楼-- · 2019-03-06 14:24

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

查看更多
男人必须洒脱
4楼-- · 2019-03-06 14:34

This question was asked before: here

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

查看更多
登录 后发表回答