Transparent, borderless ProgressDialog

后端 未结 3 1951
遇见更好的自我
遇见更好的自我 2021-01-17 14:34

I\'ve got a ProgressDialog that I have positioned to the bottom of my screen as to not overlap a logo. What I would like to do is create a custom style for the

3条回答
  •  情书的邮戳
    2021-01-17 15:14

    This can help you (worked for me):

    Create a layout in res/layout, like this (named, for example, as progressbar.xml):

    
    
       
    
    

    Then, put this code in your Activity or Fragment:

    private ProgressDialog progressDialog;
    
    // the first parameter (this) is your activity
    // ... but if you need to use this code in a Fragment, use getActivity() instead 
    progressDialog = ProgressDialog.show(this,null,null);  
    progressDialog.setContentView(R.layout.progressbar);
    

    So, the ProgressDialog will to show without background and border.

提交回复
热议问题