android - Failed to display the text beside progress bar -
how make test%
display beside progress bar
? use android:layout_toleftof
, android:layout_tostartof
, doesn't work.
<?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:paddingleft="90dp" android:layout_height="wrap_content" android:minheight="20dip" android:maxheight="20dip" android:minwidth="130dip" android:maxwidth="130dip" android:layout_toendof="@id/listproject" android:progressdrawable="@drawable/progressbar2" android:layout_torightof="@+id/listproject"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toleftof="@+id/downloadprogressbar" android:layout_tostartof="@id/downloadprogressbar" android:paddingleft="100dp" android:text="test %"/> </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>
after remove android:paddingleft="100dp"
textview test % not show because paddingleft = 100dp
or can remake layout
<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_torightof="@+id/listproject2" android:layout_height="wrap_content" android:minheight="20dip" android:maxheight="20dip" android:minwidth="130dip" android:maxwidth="130dip" android:progressdrawable="@drawable/progressbar2" /> <textview android:id="@+id/listproject2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="test %" android:layout_marginleft="90dp" android:layout_marginright="8dp" /> </relativelayout>
Comments
Post a Comment