2010-11-18 159 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