I would like to have a view that combines an image with some text and
have the bottom of the image be on the text baseline. I am using the
following:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
I tried adding android:baselineAligned="true" to the LinearLayout, but
that didn't work; the top of the image stayed aligned with the top of
the text. Is there a different attribute I should use, or maybe a
different container than LinearLayout?
A separate question: is imageView.setImageResource(-1); a good way to
have an ImageView be empty (display no image and take up no space)? It
seems to work, but I don't know if it may cause problems to set a