不同的设计,在横向和纵向的android [英] Different design for landscape and portrait orientation android

查看:137
本文介绍了不同的设计,在横向和纵向的android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以有一个不同的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

您可以在<再更是指在同一href="http://developer.android.com/training/basics/supporting-devices/screens.html">http://developer.android.com/training/basics/supporting-devices/screens.html

这篇关于不同的设计,在横向和纵向的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆