我想將這個gridview對齊,以便它與屏幕右側齊平,但似乎總是立即跟隨我將其設置在右側的任何textview。不僅如此,而且所有的文本瀏覽都是相互顯示的。不符合Relativelayout對齊的GridView
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/time_left"
android:textSize="30sp"
android:layout_alignParentLeft="true"
android:id="@+id/time_left_label"/>
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/time_left"
android:layout_alignParentLeft="true"
android:layout_below="@id/time_left_label"/>
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/progress"
android:textSize="30sp"
android:layout_alignParentLeft="true"
android:layout_below="@id/time_left"
android:id="@+id/progress_label" />
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/progress"
android:layout_alignParentLeft="true"
android:layout_below="@id/progress_label"/>
<GridView android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/main_grid"
android:numColumns="2"
android:layout_alignParentRight="true"
android:layout_toRightOf="@id/time_left_label"
android:stretchMode="none" />
</RelativeLayout>
下面是我想快速繪製的圖片! http://imgur.com/x7Ypr
1.文字瀏覽在彼此之上,因爲它們都是左對齊的。使用android:layout_toRightOf =「」,它們不會重疊。如果 可以啓動繪畫並繪製所需佈局的圖片,我們可能會更輕鬆地幫助您。 – Renard 2012-04-08 19:40:27