ProgressBar dialog Without Border

前端 未结 2 1487
小鲜肉
小鲜肉 2021-01-16 11:25

I am displaying a ProgressBar in Android, as seen below:

\"alt

but there is a

2条回答
  •  暖寄归人
    2021-01-16 11:47

    do you still need ideas for this? I implemented the same thing in my app, but not as a dialog, I had two layouts that overlap each other. I then flip between the two layouts by setting the visibility .setVisibility(). As for the actual progress bar itself, I use this:

    EDIT: Here's my whole XML file:

     
         
               
           
        
         
      
      
     
     
      
         
    
    

    I use this layout for an Activity with an AsyncTask, so onPreExecute(), I do something like:

    @Override
    protected void onPreExecute(){
     findViewById(R.id.list_contents).setVisibility(View.GONE);
     findViewById(R.id.spinner_layout).setVisibility(View.VISIBLE);
    }
    

    And then do whatever I have to do, and onPostExecute() I have:

    @Override
    protected void onPostExecute(Cursor cursor){
     findViewById(R.id.list_contents).setVisibility(View.VISIBLE);
     findViewById(R.id.spinner_layout).setVisibility(View.GONE);
    }
    

提交回复
热议问题