【发布时间】:2013-05-02 09:40:46
【问题描述】:
我有一个ProgressBar,它在WebView 加载时显示。我希望ProgressBar 以小尺寸显示,而背景为黑色。然后我可以在 WebView 加载后关闭进度条。
我遇到的问题是WebView 在加载时是白色的。有什么办法让它变黑吗?如果我将WebView 的背景颜色设置为黑色,那么短暂的一秒钟,它仍然是白色,并且使加载非常难看。
Activity的布局是:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<WebView
android:id="@+id/WebView"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<ProgressBar
android:id="@+id/ProgressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone" />
</RelativeLayout>
或者,我应该使用某种类似于 Android 进度条的图像吗?
【问题讨论】:
标签: android android-webview android-progressbar