美文网首页Android
代码实现webview中添加进度条

代码实现webview中添加进度条

作者: onlyxing | 来源:发表于2017-12-21 09:28 被阅读2次

    1.在代码中添加

    mProgressBar.setProgressDrawable(drawable);

    ProgressBar mProgressBar=newProgressBar(getActivity(),null,android.R.attr.progressBarStyleHorizontal);

    LinearLayout.LayoutParams layoutParams =newLinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT,8);

    mProgressBar.setLayoutParams(layoutParams);

    Drawable drawable = getActivity().getResources().getDrawable(R.drawable.webview_loading_line);

    mProgressBar.setProgressDrawable(drawable);

    webView.addView(mProgressBar);

    2.webview_loading_line.xml

    相关文章

      网友评论

        本文标题:代码实现webview中添加进度条

        本文链接:https://www.haomeiwen.com/subject/visowxtx.html