Android ProgressDialog with setContentView

前端 未结 3 912
长情又很酷
长情又很酷 2020-12-09 20:44

I\'ve read a hell of a lot about this, and can\'t see anyone who\'s done or tried it before.

So I\'ve got an object that extends ImageView, then within this I call a

3条回答
  •  无人及你
    2020-12-09 21:06

    I made it; in fact, it's very easy; using

    loadingProgressDialog.setContentView(this) 
    

    after

    loadingProgressDialog.show() 
    

    The following lines of code are unnecessary:

    loadingProgressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    loadingProgressDialog.requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    loadingProgressDialog.getWindow().requestFeature(Window.FEATURE_PROGRESS);
    loadingProgressDialog.getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    

    that's to say:

    loadingProgressDialog.setIndeterminate(true);
    loadingProgressDialog.show();
    loadingProgressDialog.setContentView(this); //this is: LoaderImageView extends ImageView 
    

    that is enough.

    I hope this can help other people looking for answer about this question.

提交回复
热议问题