我有我的應用程序的幾個屏幕,我儘量讓它們適合所有尺寸的屏幕,但沒有成功,所以我附上屏幕,希望求助。我想使這個屏幕分辨率好所有尺寸的屏幕我應該改變
什麼,我想在這個屏幕上得到的是:1, 向widget43上屏幕 2. widget49的頂部在屏幕 3. widget47問題之一的中間的底部即使widget49沒有佔用全部空間,屏幕也是如此。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/widget42"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<RelativeLayout
android:id="@+id/widget43"
android:layout_width="fill_parent"
android:layout_height="34px"
android:background="@color/blue"
>
<TextView
android:id="@+id/convertedTitleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
>
</TextView>
<Button
android:id="@+id/convertedBackButton"
android:layout_width="wrap_content"
android:layout_height="32px"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:onClick="backButtonOnClick"
android:text="Back" android:typeface="monospace" android:textColor="@color/white" android:textColorHint="@color/blue" android:background="@color/blue">
</Button>
<Button
android:id="@+id/convertedCancelButton"
android:layout_width="wrap_content"
android:layout_height="32px"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:onClick="cancelButtonOnClick"
android:text="Cancel" android:background="@color/blue" android:textColor="@color/white">
</Button>
</RelativeLayout>
<RelativeLayout
android:id="@+id/widget49"
android:layout_width="fill_parent" android:layout_gravity="bottom" android:layout_height="310dip">
<ListView
android:layout_width="fill_parent"
android:layout_alignParentTop="true"
android:id="@+id/convertedListView" android:hapticFeedbackEnabled="true"
android:layout_below="@+id/widget47" android:layout_above="@+id/widget49" android:layout_alignBottom="@+id/widget43" android:layout_height="match_parent">
</ListView>
</RelativeLayout>
<RelativeLayout android:id="@+id/widget47" android:background="@color/blue" android:layout_width="match_parent" android:layout_height="wrap_content">
<TextView android:layout_centerVertical="true" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_centerHorizontal="true" android:id="@+id/countConvertedTextView" android:text="TextView"></TextView>
</RelativeLayout>
</LinearLayout>
感謝您的幫助!
在不同大小屏幕上的Relative_Layout(widget47)並不總是在scr的底部EEN。 – dirko 2011-04-06 06:33:25
首先,您必須將主要線路佈局更改爲相關佈局。那麼你必須在widget27中添加android:layout_alignParentBottom =「true」屬性。現在它會一直到底 – 2011-04-06 06:42:27
我已經做了這樣的結果是Relative_Layout(widget47)將widget49之間的所有空間都放在底部。這意味着是在底部,但是變化是一個錯誤的大小不像我去wrap_content – dirko 2011-04-06 06:53:42