晚上好。LinearLayout中的LinearLayout包含3個元素 - 一個指向左側,一個指向中心,另一個指向右側
我擺弄這一個多小時,現在我沒有得到它的工作。 我想創建一個版面看起來應該像這樣的:
我想有神韻:向左一個TextView,中心的進度和神韻:向右另一個TextView的。我不想使用靜態寬度,因爲佈局應該用於不同的設備。
不幸的是我的佈局看起來像這樣的時刻:
我沒有找到通過谷歌的任何解決方案,因此任何幫助非常感謝。 這是我的佈局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/txtProgress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="TextView" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25sp"
android:layout_marginRight="5sp"
android:gravity="center"
android:text="0 %" />
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.36" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="right"
android:layout_marginLeft="5sp"
android:layout_marginRight="25sp"
android:gravity="right"
android:text="100 %" />
</LinearLayout>
</LinearLayout>