什么是一个RelativeLayout的定位控制,使其显示相同的正确方法 [英] What is the correct way to position controls in a RelativeLayout so that it displays the same

查看:201
本文介绍了什么是一个RelativeLayout的定位控制,使其显示相同的正确方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是一个RelativeLayout的定位控制,以便它显示不管设备Resolution.I想这是再清楚不过,如果我们使用 DP 值相同的正确方法在给像安卓边距:layout_marginTop =17dp它会显示在MDPI,xhdpi,华电国际

What is the correct way to position controls in a RelativeLayout so that it displays the same irrespective of Device Resolution.I guess this is clear enough,If we use dp values in giving margins like android:layout_marginTop="17dp" It displays at different places on mdpi,xhdpi,hdpi.

有人可以给一个完整成熟的解决方案,guenine给它?谢谢

Can someone give a full fledged guenine solution to it? Thanks

推荐答案

您应该有不同的屏幕大小不同的布局。例如,对于xhdpi屏幕创建布局xhdpi文件夹,并把layout.xml为xhdpi屏幕在那里。同样对于其他的屏幕尺寸。有没有办法有一个布局完全相同长得一模一样所有显示器上。

You should have different layouts for different screen sizes. For example for xhdpi screens you create layout-xhdpi folder and put layout.xml for xhdpi screens in there. The same for other screen sizes. There is no way to have one layout looking exactly the same on all displays.

看到这个: http://developer.android.com/guide/practices/screens_support html的

这篇关于什么是一个RelativeLayout的定位控制,使其显示相同的正确方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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