我设置进度对话框主要活动,我在进度对话框上设置了custom_dialog.xml布局(使用自定义进度对话框),你从图片中显示有来自主要活动的顶部和底部区域显示,我会布局或者进度对话框显示在所有页面或屏幕上,如启动活动
custom_dialog.xml ::
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/icon" >
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"/>
</RelativeLayout>
如何通过xml或java代码解决它?
答案 0 :(得分:0)
试试这个
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
androud:scaleType="fitXY"
android:background="@drawable/icon"
/>
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"/>
</RelativeLayout>