Chcę stworzyć układ, który wyrównuje górną część obrazu na szczycie TextView jak ten:Align top obrazu do góry 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.
Próbowałem robić to poprzez ustawienie android:drawableLeft
do mojego obrazu , ale że centra obraz w pionie:
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.
jest to możliwe tylko z TextView czy muszę utworzyć RelativeLayout zawierający TextView oraz ImageView?
Oto układ XML dla mojego TextView który daje nieprawidłowy układ:
<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" />
Atrybut android:gravity="top"
tylko wydaje się wpływać na tekst, a nie rozciągliwej.
Myślę, że trzeba użyć relativeLayout ... – amp
czy trzeba w górę lub w lewo –
jak @amp mówi używać względna layout Najlepiej .. – MAC