如何改变进度对话框的位置? [英] How to change the position of a progress dialog?

查看:134
本文介绍了如何改变进度对话框的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序,并且需要知道如何改变进度对话框的定位。予需要它被定位在屏幕的底部,而不是在中心像它是由缺省

I'm developing an android app and need to know how to change the positioning of a progress dialog. I need it to be positioned at the bottom of the screen instead of at the center like it is by default.

推荐答案

您可以致电 ProgressDialog#getWindow#setGravity(...)来改变重力。

You can call ProgressDialog#getWindow#setGravity(...) to change the gravity.

所以:

ProgressDialog dialog = ProgressDialog.show(AContext, "Test", "On the bottom");
                dialog.getWindow().setGravity(Gravity.BOTTOM);

这篇关于如何改变进度对话框的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆