Java Android ProgreesBar仅显示进度条,不显示背景矩形框
Java Android ProgreesBar仅显示进度条,不显示背景矩形框,java,android,android-styles,Java,Android,Android Styles,正如你所看到的,上面图像中的进度条在中间有蓝色条带,这是进度指示器,在这个进度指示器的周围有一个黑盒子。在我的应用程序中,我希望这个进度条只作为蓝色的进度指示器,没有Sorrounding黑匣子。带有样式Widget.ProgressBar.Horizontal的进度条只显示进度指示器,但它不像进度条样式Widget.Holo.Light.ProgressBar.Horizontalrizontal那样薄。我看着它就像下图所示。我查看了进度条的参考文档,但没有找到任何东西。()那么是否有任何xm
正如你所看到的,上面图像中的进度条在中间有蓝色条带,这是进度指示器,在这个进度指示器的周围有一个黑盒子。在我的应用程序中,我希望这个进度条只作为蓝色的进度指示器,没有Sorrounding黑匣子。带有样式
Widget.ProgressBar.Horizontal
的进度条只显示进度指示器,但它不像进度条样式Widget.Holo.Light.ProgressBar.Horizontalrizontal
那样薄。我看着它就像下图所示。我查看了进度条的参考文档,但没有找到任何东西。()那么是否有任何xml属性会消失或隐藏周围的黑框?
使用以下代码:
<LinearLayout
android:orientation="horizontal"
<!-- SPECIFY HERE YOUR BACKGROUND, LENGTH AND WIDTH -->
... >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/Widget.ProgressBar.Small"
android:layout_marginRight="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/loading" />
</LinearLayout>
...
使用以下代码:
<LinearLayout
android:orientation="horizontal"
<!-- SPECIFY HERE YOUR BACKGROUND, LENGTH AND WIDTH -->
... >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/Widget.ProgressBar.Small"
android:layout_marginRight="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/loading" />
</LinearLayout>
...
必须将进度条xml标记包含在另一个LinearLayout标记中。在线性布局标记中定义矩形的长度、宽度和背景色。@我非常感谢您的建议,但我不想要任何背景,我只想要蓝色进度条。您必须将进度条xml标记包含在另一个线性布局标记中。在线性布局标签中定义矩形的长度、宽度和背景色。@我很感激你的建议,但我不想要任何背景,我只想要蓝色进度条。