テキストビューと画像用の固定スペースがある下のレイアウトを実現したい。
「重み」プロパティを持たない相対レイアウトを使用しています。LinearLayout を使用して以下のレイアウトを実現するには?
以下は私のコードです
<RelativeLayout>
<TextView
android:id="@+id/txt"
android:paddingLeft="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:textSize="14dp"
android:textColor="@android:color/white"/>
<TextView
android:id="@+id/date_n_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:textColor="#E0FFFF"
android:layout_below="@+id/txt" />
<ImageView android:id="@+id/imageview"
android:layout_height="wrap_content"
android:paddingRight="5dp"
android:contentDescription="Image"
android:layout_width="wrap_content"
android:layout_alignParentRight="true"
android:src="@drawable/icon"/>
</RelativeLayout>
上記の画像のように、テキストビューと画像を配置するために RelativeLayout を使用しました。しかし、textview と imageview は互いに重なっています。