2012-04-08 4 views
1

このグリッドビューを画面の右側に並べるように調整したいのですが、右側に設定したテキストビューの直後に表示されるようです。それだけでなく、テキストビューのすべてがお互いの上に表示されます。GridViewがRelativelayoutアラインメントに準拠していません

<?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

+0

1.テキストビューはすべて左揃えになっているため、相互に重なり合っています。 android:layout_toRightOf = ""を使用してオーバーラップすることはありません。 あなたがペイントしてあなたの希望するレイアウトの写真を描くことができれば、より簡単に時間を過ごすことができます。 – Renard

答えて

1

私はそれが整列したいどうすればよい、まさにこのGridViewの

を右揃えしたいのですが?あなたはそれが何をしているか言及しますが、あなたが望むものは言いません

...私は、あなたがlayout_alignParentRightlayout_toRightOfを使用している

Welllの右側に設定どちらのTextView従っているようです。

textviewsが互いの上に表示されます。

TextViewsをお互いに配置しても、それらは重なって表示されません。 orientationverticalに設定してLinearLayoutを使用するか、layout_belowを使用して相互に配置することができます。

+0

私はテキストを重ならないように変更しました。ありがとう、私は今、それを考えていないために愚かな気分になります。 – worr

関連する問題