如何更改佈局以使圖像1更像圖像2?我不介意它是向上移動的文字還是向上移動的圖像。Android ImageView佈局對齊
我的佈局文件是像這樣: -
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="1"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:orientation="vertical" >
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/imp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/stats_chr" />
<TextView
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right|center_vertical"
android:singleLine="true"
android:text="AA" />
</LinearLayout>
嘗試將Gravity設置爲您的'LinearLayout'和'ImageView'兩個'android:layout_gravity =「top」' –
地牢爬行貓! –