顶我想创建对齐图像的顶部这样一个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