Android:不同屏幕尺寸的按钮方向

Android:不同屏幕尺寸的按钮方向,android,android-layout,android-button,Android,Android Layout,Android Button,我的按钮布局有问题 我制作了“小、普通、大、xlarge”布局文件夹 但在某些设备上,按钮还是混在一起了 当我使用设备集eclipse查看布局时,我可以看到问题,但我不知道设备的尺寸是多少 我的问题是:有人能告诉我这些设备的尺寸吗?或者我能为每个设备做一个布局吗 图像中的设备爆炸了 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.co

我的按钮布局有问题

我制作了“小、普通、大、xlarge”布局文件夹

但在某些设备上,按钮还是混在一起了

当我使用设备集eclipse查看布局时,我可以看到问题,但我不知道设备的尺寸是多少

我的问题是:有人能告诉我这些设备的尺寸吗?或者我能为每个设备做一个布局吗

图像中的设备爆炸了

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/mainnati"
    android:gravity="center_horizontal" >


>
        <Button

        android:id="@+id/b_info"
        android:layout_width="220dp"
        android:layout_height="50dp"
        android:layout_centerVertical="true"
        android:background="@drawable/info" />



    <Button
        android:id="@+id/b_pass"
        android:layout_width="220dp"
        android:layout_height="50dp"
        android:layout_alignLeft="@+id/b_comp"
        android:layout_below="@+id/b_comp"
        android:layout_marginTop="350dp"
        android:background="@drawable/pass" />

</RelativeLayout>


>

两件事:我看到两个按钮。
第二个在下面,与代码中不存在的一个(b_comp)的左侧对齐。
所以,我想它应该是指b_info

而且,我没有设置centerVertical,而是为第一个按钮(b_info)设置了centerInParent(也可以水平居中)。
我会使用“中心水平”按钮,而不是“左对齐”

因此,毕竟,我的布局文件是:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/mainnati"
    android:gravity="center_horizontal" >
    >
    <Button
        android:id="@+id/b_info"
        android:layout_width="220dp"
        android:layout_height="50dp"
        android:layout_centerInParent="true"
        android:background="@drawable/info" />
    <Button
        android:id="@+id/b_pass"
        android:layout_width="220dp"
        android:layout_height="50dp"
        android:layout_centerHorizontal="true"
        android:layout_below="@id/b_info"
        android:background="@drawable/pass" />
</RelativeLayout>

>

发布布局文件。我添加了布局文件,我使用了很多硬编码,我知道!。但责任却落在了教我这种方法的人身上。。我必须尽快完成这个项目。两件事:我看到两个按钮。第二个在下面,与代码中不存在的一个(b_comp)的左侧对齐。所以,我想它应该指的是b_信息,而不是你所说的“按钮混合在一起”到底是什么意思?此外,您还讨论了几个(“小型、普通、大型、xlarge”)布局文件夹,但只显示一个布局XML。你真的需要4种不同的布局吗?(这可能是个坏主意。)首先,试着仔细阅读。谢谢你,先生,你的编辑对我帮助很大!现在它就像一个符咒,你能解释一下我的工作出了什么问题吗我已经看过你之前给我的链接了很抱歉,这是一个复制/粘贴错误。-我制作了4个布局文件夹,使布局与不同的屏幕一起工作,因此系统将选择适合当前屏幕的布局。再次感谢。很高兴它起作用了。你需要更深入地了解亲戚是如何工作的。你也不必道歉。错误时有发生。我还认为你不必做出4种不同的布局。只需为按钮的宽度和高度提供“包装内容”。显然,您必须提供4种不同版本的图像,以您希望支持的分辨率(dpi)。这就是全部。