android - Image View not showing image in a Custom ListView -


there no errors crashing program, want image aligned. image shown left of text if imageview placed before textview

my custom layout navigationdrawer

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="horizontal"     android:layout_width="match_parent"     android:layout_height="match_parent">  <textview     android:layout_width="wrap_content"     android:layout_height="50dp"     android:textappearance="?android:attr/textappearancemedium"     android:gravity="center_vertical"     android:layout_marginleft="5dp"     android:textcolor="#ffffff"     android:text="new text"     android:id="@+id/bookname" />  <imageview     android:layout_width="40dp"     android:layout_height="40dp"     android:layout_margintop="5dp"     android:layout_marginright="5dp"     android:id="@+id/bookimageview" />  </linearlayout> 

how make image float right of text , points right edge of listview. 1 more thing, layout being used in navigationdrawer, listview covers less full width... thanks!!!

change layout_width of textview match_parent wrap_content:

android:layout_width="wrap_content" 

Comments