【发布时间】:2016-08-03 13:30:59
【问题描述】:
在 xml 布局中,当我单击进度条时,我确实看到它位于我希望的位置,但在实时时,我看不到它,感觉就像它隐藏在按钮下方。
我试过了:
- 更改视图的位置(进度条上方/下方的按钮)
- 不确定
- 玩转 ProgressBar 的风格
似乎没有任何效果。
这是我的 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>
【问题讨论】:
-
可能是因为你需要改变进度条的颜色
-
以前试过不同的颜色,不是这样。
-
将这些添加到您的主题基础样式
- #ffff4444
- #ff0099cc
再试一次 -
只是一个用户意识的评论:这看起来很糟糕。至少隐藏文本。
-
@m0skit0 显然......这只是一个例子,在一些随机绘画程序上制作
标签: android android-layout android-xml android-button android-progressbar