Android的ProgressDialog位置的问题,我们是否有Android的ProgressDialog从平台或支持库? [英] Android ProgressDialog position issue and do we have Android's ProgressDialog from platform or support library?

查看:256
本文介绍了Android的ProgressDialog位置的问题,我们是否有Android的ProgressDialog从平台或支持库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个ProgressDialog工作正常时,我的设备是4.4.4,我并没有在做这个应用程序最近和设备升级到Lillipop意味着一段时间。我不知道这是否造成了什么这个问题,但只是提。

I had this ProgressDialog working fine when my device was in 4.4.4 and I was not working on this app recently and device is upgraded to Lillipop mean while. I am not sure if this has caused anything to this issue but just mentioning.

问题1。 ProgressDialog显示在屏幕的左上角。见附件图片。以下是code。还如何让背景透明?

Question 1. ProgressDialog shows on top left of the screen. See the attached pic. And below is the code. Also how to get transparent background ?

        progressDialog = new ProgressDialog(this, android.R.style.Theme_DeviceDefault_Light_Dialog_Alert);
    progressDialog.setTitle(title);
    progressDialog.setMessage(getResources().getString((R.string.progress_please_wait)));
    progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    progressDialog.setIndeterminate(true);
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.getWindow().setGravity(Gravity.CENTER);
    progressDialog.show();

在这里输入的形象描述

问题2。我已经通过材料设计文档和支持文档不见了。我找不到但没有任何内置的材质设计ProgressDialog。或者我们应该依赖于像 https://github.com/rahatarmanahmed/CircularProgressView 库。 ?

Question 2. I have gone through the material design docs and support docs. I could not find but is there any built in Material Designed ProgressDialog. Or we should depend on the libraries like https://github.com/rahatarmanahmed/CircularProgressView. ?

编辑:结果
ClarkXP的回答,其实更相关,对另外一个问题提到如下:结果
问题3。我试图使用材料对话框但我gradle这个已抛出错误无法解析:编译com.afollestad:材料对话框:0.8.5.1。

EDIT :
ClarkXP's answer, in fact more relevant, for another question mentioned below:
Question 3. I tried to use the material-dialogs but my gradle has thrown as error "Failed to resolve: compile com.afollestad:material-dialogs:0.8.5.1".

推荐答案

要显示与材料设计风格progressDialogs,我使用的材料-对话框库。

To show progressDialogs with material design style, I use Material-Dialogs library.

问候

更新

该应用的build.gradle必须有在同一个文件储存库和依赖性下一配置:

The app build.gradle must have the next configuration for repositories and dependencies in the same file:


  1. 在Android的关闭:

  1. In Android closure:

android {    
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    ...[your configuration]
}


  • 和库/闭依赖关系:

  • And Repositories/Dependencies closure:

    repositories {
        maven {
            url "https://jitpack.io"
        }   
    }
    dependencies {   
        compile('com.github.afollestad.material-dialogs:core:0.8.5.1@aar'){
            transitive = true
        }
    }
    


  • 这篇关于Android的ProgressDialog位置的问题,我们是否有Android的ProgressDialog从平台或支持库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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