我想在一個標準的按鈕中間創建一個進度條,這樣的事情: 進度在按鈕的中間
在XML佈局,當我點擊的進度,我做看到它位於我希望的位置,但實時,我看不到它,它感覺就像隱藏在按鈕下面。
我已經試過:
- 更改視圖的定位(鈕高於/低於進度)
- 不確定
- 與進度的風格演奏
似乎沒有什麼是工作。
這裏是我的xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<Button
android:id="@+id/button_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:elevation="1dp"
android:text="test button" />
<ProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/button_id"
android:layout_alignTop="@+id/button_id"
android:layout_centerHorizontal="true"
android:indeterminate="true"
android:indeterminateTint="@android:color/holo_blue_dark"
android:visibility="visible" />
</RelativeLayout>
也許是因爲你需要前更改進度條 – has19
的顏色嘗試了不同的顏色,它不是。 – Dus
將這些添加到您的主題庫樣式中- #ffff4444
- #ff0099cc
並再試一次 –
has19