2010-11-18 157 views
0

在我的主屏幕中,我设置了一个图像作为背景,并在布局底部的该背景图像上设置了三个图像按钮。它(三个图像按钮)在480x854屏幕设备中看起来很完美,但在240x320设备的屏幕尺寸中却不是这样。我使用的XML布局是:Android设备屏幕尺寸问题

<?xml version="1.0" encoding="UTF-8"?> 
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:orientation="vertical" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:background="@drawable/inscreen"> 
     <ImageView android:id="@+id/clip" 
        android:layout_height="wrap_content" 
        android:layout_width="wrap_content" 
        android:layout_alignParentBottom="true" 
        android:layout_marginBottom="95dip" 
        android:layout_gravity="bottom|center" 
        android:src="@drawable/selector"/> 
     <ImageView android:id="@+id/catagoryvid" 
        android:layout_height="wrap_content" 
        android:layout_width="wrap_content" 
        android:layout_alignParentBottom="true" 
        android:layout_marginBottom="55dip" 
        android:layout_gravity="bottom|center" 
        android:src="@drawable/selector1"/> 
     <ImageView android:id="@+id/search" 
        android:layout_height="wrap_content" 
        android:layout_width="wrap_content" 
        android:layout_alignParentBottom="true" 
        android:layout_marginBottom="15dip" 
        android:layout_gravity="bottom|center" 
        android:src="@drawable/selector2"/> 
    </FrameLayout> 

任何帮助?

感谢。

+0

添加您的XML布局详细信息以获得更多理解。 – Sandy 2010-11-18 12:29:58

回答

1

您应该使用相对布局来处理这种类型的问题,在这种情况下,无论屏幕大小如何,您都可以将控件放在相对位置。

+0

我已经尝试过,但没有工作 – Piyush 2010-11-18 13:03:14

+0

你试过的东西可以粘贴在这里,以便我可以帮助你,如果有任何 – Sandy 2010-11-18 13:15:03

+0

谢谢你的回复,我已经解决了我的问题 – Piyush 2010-11-23 08:23:52