【发布时间】:2012-05-20 02:38:41
【问题描述】:
如何正确防止 ProgressBar 与最右侧的视图重叠?请注意,我不想使用 TableLayout。我也已经读过这篇优秀的 SOF link。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp" >
<RelativeLayout
android:id="@+id/rel_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="LLL" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/RIGHT"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="RRR" />
</RelativeLayout>
<ProgressBar
android:id="@+id/pb"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="5sp"
android:layout_toRightOf="@+id/rel_left"
android:max="100"
android:progress="80" />
</RelativeLayout>
【问题讨论】:
标签: android progress-bar android-relativelayout overlap