我有此代码以显示进度对话框:
@Override
public void onPreExecute() {
if(progress == null)
progress = ProgressDialog.show(MainActivity2.this, null , null);
progress.setContentView(R.layout.progressbar_activity);
}
这是我的progressDialog 布局。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/Widget.ProgressBar.Small.Inverse"
android:layout_marginRight="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/loading" />
</LinearLayout>
这是我的主要活动布局:
<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"
android:background="@android:color/white"
android:orientation="vertical"
tools:context=".MainActivity" >
<LinearLayout
android:id="@+id/tittle_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:color/black"
android:gravity="center"
android:orientation="vertical"
android:paddingTop="6dip" >
<Button
android:id="@+id/start_progress"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/hello_world" />
</LinearLayout>
</RelativeLayout>
如您所见,背景颜色为白色。
当我单击 mainActivity 中的按钮时,会出现进度对话框,但页面的背景颜色变为gray。
-------->
我希望它默认为白色,进度对话框文本为黑色。我错过了什么?