如何在foodpanda android app中创建进度对话框

时间:2016-01-08 11:54:42

标签: android android-progressbar

我想创建一个进度对话框,其中一个图像显示在微调器内,就像在foodpanda android app中一样。应该如何做?

我正在使用此代码。

 dialog = new ProgressDialog(context);
    dialog.setMessage(context.getResources()
            .getString(R.string.pleasewait));

    dialog.show();

1 个答案:

答案 0 :(得分:0)

<RelativeLayout ...>

    <Spinner ...
        android:id="@+id/spin"
        android:layout_width="48dp" />

    <!-- make the padding wider than the visible part of the spinner 
         and the image match the spinner size and voila it will show in the middle -->
    <ImageView ...
        android:layout_width="48dp"
        android:padding="10dp" 
        android:layout_alignBottom="@id/spin"
        android:layout_alignLeft="@id/spin" />

</RelativeLayout>