admin管理员组文章数量:1534201
自定义WebView,命名ProgressWebView,该ProgressWebView的一个特点,加载网页地址的时候,动态显示加载进度,和普通浏览器差不多,代码如下:
public ProgressWebView(Context context, AttributeSet attrs) {
super(context, attrs);
progressbar = new ProgressBar(context, null,android.R.attr.progressBarStyleHorizontal);
progressbar.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,10, 0, 0));
Drawable drawable = context.getResources().getDrawable(R.drawable.progress_bar_states);
progressbar.setProgressDrawable(drawable);
addView(progressbar);
setWebViewClient(new WebViewClient(){});
setWebChromeClient(new WebChromeClient());
//是否支持缩放
getSettings().setSupportZoom(true);
getSettings().setBuiltInZoomControls(true);
}
版权声明:本文标题:简易浏览器 java_365备用「永久地址0365.tv」java 实现简单浏览器&Android 开发之快速实现一个简单Web浏览器... 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1726871214a1087879.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论