不同的设计,在横向和纵向的android纵向、横向、不同、android

2023-09-12 10:30:52 作者:旧伤

我们可以有一个不同的XML景观和不同的XML为纵向?

Can we have a different xml for landscape and different xml for portrait orientation?

我工作的一个简单的应用程序,有几个按钮,textviews的XML看起来纵向不错,但与相同的XML当我检查了横向,设计不好看。

I am working on a simple app, have few buttons and textviews, the xml looks good in portrait, But with same xml when I check the landscape orientation, design doesn't look good.

任何建议都是AP preciated .. 谢谢你。

Any suggestions are appreciated.. Thank you.

推荐答案

是ofcourse。

Yes ofcourse.

您必须创建两个版本的XML文件,并把布局中的端口和布局,土地文件夹内的res文件夹。

You will have to create two versions of xml files and put in layout-port and layout-land folder inside res folder.

例如:

res/layout-land [Landscape Mode]
main.xml 
res/layout-port [Portrait Mode ]
main.xml

您可以在http://developer.android.com/training/basics/supporting-devices/screens.html

 
精彩推荐
图片推荐