dimanche 10 mai 2015

How to build a "right to left" linearlayout?

I want to make a chatroom bubble listview, and i meet a problem; The right bubble layout xml is below

<LinearLayout xmlns:android="http://ift.tt/nIICcg"
xmlns:card_view="http://ift.tt/GEGVYd"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="end"
android:orientation="horizontal" >

<TextView
    android:id="@+id/textMsg"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

<ImageView
    android:id="@+id/portrait"
    android:layout_width="40dip"
    android:layout_height="40dip" />

 </LinearLayout>

and the result looks like the picture, why does it go out of the left border

enter image description here

Aucun commentaire:

Enregistrer un commentaire