Android Progress bar on ImageView

后端 未结 2 402
情话喂你
情话喂你 2021-01-31 20:53

I am developing an app in which user will take Picture from camera and display it on preview screen having image view.

**CameraCapture.java**

class ButtonClickH         


        
2条回答
  •  悲哀的现实
    2021-01-31 21:19

    Put your ImageView and Progressbar in a RelativeLayout. For your ProgressBar, use:

    android:layout_centerInParent="true"
    

    Which will center it in the RelativeLayout, meaning over the ImageView. You might also want to hide the ProgressBar when the image has loaded:

    progressBar.setVisibility(View.Gone)
    

    when the image has been loaded.

    Sample code:

     
    
             
    
            
    
        
    

提交回复
热议问题