頂我想創建對齊圖像的頂部這樣一個TextView頂部的佈局:對齊的頂部圖像對TextView的
--------- Text text text text text text text
| Image | text text text text text text text
--------- text text text text text text text
text text text text text text text
text text text text text.
我試圖通過設置android:drawableLeft
到我的形象做這個,但垂直居中圖像:
Text text text text text text text
--------- text text text text text text text
| Image | text text text text text text text
--------- text text text text text text text
text text text text text.
這是可能的只是一個TextView還是我需要創建一個包含一個TextView和ImageView的一個RelativeLayout的?
這裏是我的TextView的XML佈局,讓不正確的佈局:
<TextView
android:gravity="top"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/image"
android:drawablePadding="8dp"
android:text="@string/text" />
的android:gravity="top"
屬性似乎隻影響文本,而不是繪製。
我認爲你需要使用的RelativeLayout ... – amp 2012-04-22 11:01:56
你是否需要在頂部或左側 – 2012-04-22 11:03:03
作爲@amp說使用相對佈局最好.. – MAC 2012-04-22 12:25:09