Friday, 6 September 2013

How to combine textview and imageview into image compound when imageview has width and height values in android?

How to combine textview and imageview into image compound when imageview
has width and height values in android?

Hi have this in my XML file:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="@+id/picture_text"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginRight="10dp"
android:src="@drawable/text"/>
<TextView
android:id="@+id/textview_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tap_message"
android:onClick="GoToMessage"
android:clickable="true"
style="@style/text_link"/>
</LinearLayout>
Android lint complains with a warning that this should be combined in a
textview compound. I can do that, but I don't understand how to set the
width, height, and margin for the imageview...
Can anyone show me how to do this?
Thanks

No comments:

Post a Comment