java - how put image view to right to row of listview -


how can put image view right of row of list view?(square image right of row)

i hope can me!

thanks in advance everybody!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

this xml:

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:orientation="horizontal" >      <checkbox          android:id="@+id/chk_box"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignparentleft="true" />     <linearlayout         android:id="@+id/linearlayout1"         android:layout_width="0dp"         android:layout_height="wrap_content"         android:layout_marginleft="5dp"         android:orientation="vertical"         android:layout_weight="1" >      <textview         android:id="@+id/name"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_torightof="@id/chk_box"         android:textstyle="bold"         android:textcolor="#000000" />         <linearlayout             android:layout_width="match_parent"             android:layout_height="match_parent">              <textview                 android:id="@+id/caratteristica"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_below="@id/name"                 android:layout_torightof="@id/chk_box"                 android:textstyle="italic" />         </linearlayout>          <!-- <textview              android:id="@+id/id"              android:layout_width="wrap_content"              android:layout_height="wrap_content"              android:layout_marginleft="5dp"              android:textsize="12sp"              android:textstyle="italic"/>-->     <linearlayout         android:layout_width="match_parent"         android:layout_height="match_parent">     <textview         android:id="@+id/dist"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_below="@id/caratteristica"         android:layout_torightof="@id/chk_box"         android:textsize="12sp"         android:textstyle="italic" />         <textview             android:id="@+id/valuta"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_marginleft="5dp"             android:textsize="12sp"             android:textstyle="italic" />     </linearlayout>     <edittext         android:layout_width="196dp"         android:layout_height="wrap_content"         android:inputtype="number"         android:ems="10"         android:id="@+id/edittext"         android:hint="quantità"         >     </edittext>     </linearlayout>  </linearlayout> 

and pic:

enter image description here

update row add image in right in center in

i used image of launcher use u take...

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:orientation="horizontal" >      <checkbox         android:id="@+id/chk_box"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignparentleft="true" />     <linearlayout         android:id="@+id/linearlayout1"         android:layout_width="0dp"         android:layout_height="wrap_content"         android:layout_marginleft="5dp"         android:orientation="vertical"         android:layout_weight="1" >          <textview             android:id="@+id/name"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_torightof="@id/chk_box"             android:textstyle="bold"             android:textcolor="#000000" />         <linearlayout             android:layout_width="match_parent"             android:layout_height="match_parent">              <textview                 android:id="@+id/caratteristica"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_below="@id/name"                 android:layout_torightof="@id/chk_box"                 android:textstyle="italic" />         </linearlayout>          <!-- <textview              android:id="@+id/id"              android:layout_width="wrap_content"              android:layout_height="wrap_content"              android:layout_marginleft="5dp"              android:textsize="12sp"              android:textstyle="italic"/>-->         <linearlayout             android:layout_width="match_parent"             android:layout_height="match_parent">             <textview                 android:id="@+id/dist"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_below="@id/caratteristica"                 android:layout_torightof="@id/chk_box"                 android:textsize="12sp"                 android:textstyle="italic" />             <textview                 android:id="@+id/valuta"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_marginleft="5dp"                 android:textsize="12sp"                 android:textstyle="italic" />         </linearlayout>         <edittext             android:layout_width="196dp"             android:layout_height="wrap_content"             android:inputtype="number"             android:ems="10"             android:id="@+id/edittext"             android:hint="quantità"             >         </edittext>     </linearlayout>      <imageview         android:id="@+id/ivimage"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_marginright="5dp"         android:layout_gravity="center"        android:src="@mipmap/ic_launcher"      />  </linearlayout> 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -