android - Display progress bar beside the text in ListView -


i'm trying make listview progress bar image below

enter image description here

i'm use android:layout_torightof display progressbar beside pro-xxx-xxx, display below text .

enter image description here

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical" android:layout_width="match_parent"     android:layout_height="match_parent">     <textview android:id="@+id/listproject"         android:textstyle="bold"         android:textcolor="@color/black"         android:layout_width="wrap_content"         android:layout_height="wrap_content"/>     <progressbar         android:id="@+id/downloadprogressbar"         style="?android:attr/progressbarstylehorizontal"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_torightof="@+id/listproject" />     <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:textcolor="@color/blue"         android:id="@+id/listtimein"/>     <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:textcolor="@color/blue"         android:layout_toleftof="@+id/listtimein"         android:id="@+id/listtimeout"/>     <textview android:id="@+id/listdescription"         android:layout_width="wrap_content"         android:textcolor="@color/blue"         android:layout_height="wrap_content"/>  </linearlayout> 

change relativelayout

enter image description here

@chintan answer

enter image description here

you need use tools provided relative layout.

your progressbar needs "torightof" "toendof" textview:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"           android:layout_width="match_parent"           android:layout_height="match_parent"           android:orientation="vertical">  <relativelayout     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:paddingtop="10dp">      <textview         android:id="@+id/listproject"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:paddingend="20dp"         android:paddingright="20dp"         android:text="test"         android:textcolor="@color/black"         android:textstyle="bold"/>      <progressbar         android:id="@+id/downloadprogressbar"         style="?android:attr/progressbarstylehorizontal"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_toendof="@id/listproject"         android:layout_torightof="@+id/listproject"/> </relativelayout>  <textview     android:id="@+id/listtimein"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:text="test"/>  <textview     android:id="@+id/listtimeout"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:text="test"/>  <textview     android:id="@+id/listdescription"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:text="test"/> </linearlayout> 

i have tested xml, , works well.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -