android - position of two textview and a imageview in linearlayout -


i preparing custom listview. want achieve this

enter image description here

i quite confused, how put imageview along textview in linearlayout. so, question how put imageview along textview in linearlayout, in image. tried this, still couldn't able implement 2 textview imageview.

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:orientation="vertical" >      <textview         android:id="@+id/textview1"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:background="#003f84"         android:textcolor="#ffffff"         android:text="textview" />     <view     android:layout_width="fill_parent"     android:layout_height="1dp"     android:background="@android:color/darker_gray"/>      <textview         android:id="@+id/textview2"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:background="#003f84"         android:textcolor="#ffffff"          android:gravity="right"         android:text="textview"/>   </linearlayout> 

still, couldn't implement this. but, going try one

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:orientation="vertical" >      <textview         android:id="@+id/abtopic"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:background="#003f84"         android:text="textview"         android:textcolor="#ffffff" />      <view         android:layout_width="fill_parent"         android:layout_height="1dp"         android:background="@android:color/darker_gray" />      <textview         android:id="@+id/abtype"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:background="#003f84"         android:gravity="right"         android:text="textview"         android:textcolor="#ffffff" />      <relativelayout         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:background="@drawable/list_selector"         android:orientation="horizontal"         android:paddingbottom="15dip"         android:paddingright="15dip"         android:paddingtop="15dip" >          <!-- title -->          <textview             android:id="@+id/abtitle"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_centervertical="true"             android:contentdescription="@string/app_name"             android:paddingleft="25dip"             android:paddingright="25dip"             android:textcolor="#0099cc"             android:textsize="18sp" />         <!-- rightend arrow -->          <imageview             android:id="@+id/itemarrow"             android:layout_width="25dip"             android:layout_height="25dip"             android:layout_alignparentright="true"             android:layout_centervertical="true"             android:contentdescription="@string/app_name"             android:src="@drawable/arrow" />         <!-- subtitle -->          <textview             android:id="@+id/absubtitle"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_centervertical="true"             android:layout_marginleft="0dip"             android:layout_torightof="@id/abtitle"             android:paddingright="25dip"             android:textcolor="#000000"             android:textsize="18sp"             android:textstyle="bold"             android:typeface="sans" />     </relativelayout>  </linearlayout> 

try code , make change according you.

<framelayout         android:layout_width="match_parent"         android:layout_height="100dp" >          <relativelayout             android:layout_width="match_parent"             android:layout_height="match_parent" >              <textview                 android:id="@+id/textview1"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_alignparentleft="true"                 android:layout_alignparenttop="true"                 android:layout_marginleft="5dp"                 android:layout_margintop="5dp"                 android:text="textview" />              <textview                 android:id="@+id/textview2"                 android:layout_width="match_parent"                 android:layout_height="2dp"                  android:layout_alignparentright="true"                 android:layout_below="@+id/textview1"                 android:text=" "                  android:background="#000000"/>              <textview                 android:id="@+id/textview3"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_alignleft="@+id/textview1"                 android:layout_below="@+id/textview1"                 android:layout_margintop="25dp"                 android:text="textview" />              <textview                 android:id="@+id/textview4"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_alignright="@+id/textview3"                 android:layout_below="@+id/textview3"                 android:layout_margintop="14dp"                 android:text="textview" />              <imageview                 android:id="@+id/imageview1"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_alignparentright="true"                 android:layout_aligntop="@+id/textview3"                 android:layout_marginright="47dp"                 android:src="@drawable/ic_launcher" />              <textview                 android:id="@+id/textview5"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_alignparentright="true"                 android:layout_below="@+id/textview2"                 android:layout_marginright="14dp"                 android:text="textview" />          </relativelayout>      </framelayout> 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -