Android: The progress bar in the window's title does not display

前端 未结 6 1019
悲哀的现实
悲哀的现实 2020-12-07 15:38

I have a web view to override the built-in browser and I want to show a progress indicator on the title bar.

This is the code:

    @Override
public v         


        
6条回答
  •  伪装坚强ぢ
    2020-12-07 16:26

    I got the same problem too.

    Because i set the android:theme="@android:style/Theme.NoTitleBar"

    I solve it by add a ProgressBar in the layout xml file, such as:

    
    
    
    
    
      
    
    
    

    In code:

    // when load url

    progressBar.setProgress(0);
    progressBar.setVisible(View.VISIBLE);
    

    ...

    // loading...progress changed

    progressBar.setProgress(progress);
    

    ...

    // when page finish

    progressBar.setVisible(View.GONE);
    

    C'est finish!

提交回复
热议问题