Android - 我如何將文本與中心對齊,左邊的texview - 和「應該與imageview的中心和右邊的textview -localTime」對齊,他們爲什麼在上面?如何將texview對齊到中心
感謝#1
Heres a pic of my layout , can see the difference ?
<LinearLayout
android:id="@+id/LinearLayout_footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:weightSum="3.0" >
<TextView
android:id="@+id/localTimestamp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:gravity="left|center_vertical"
android:text="localTime"
/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:gravity="right|bottom"
android:weightSum="1.0" >
<TextView
android:id="@+id/weather"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:gravity="right|bottom"
android:text="w"
android:textColor="#FFFFFF"/>
<ImageView
android:id="@+id/ic_weather"
android:layout_width="25dip"
android:layout_height="25dip"
android:layout_toRightOf="@+id/weather"
android:background="@drawable/w_1"
android:contentDescription="@string/todo"
android:gravity="right|bottom" />
<TextView
android:id="@+id/temperature"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/ic_weather"
android:gravity="right|bottom"
android:text="@string/t"
/>
<TextView
android:id="@+id/unitTemp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right|bottom"
android:layout_toRightOf="@+id/temperature"
android:text="@string/c"
/>
</RelativeLayout>
</LinearLayout>
謝謝,現在是完美的:) – primo
歡迎...設計總是在Android的我最喜歡的事情;) – WonderSoftwares