Android自定义栏与网页加载进度条优化.pdfVIP

  • 1
  • 0
  • 约1.03万字
  • 约 6页
  • 2026-01-23 发布于北京
  • 举报

Android自定义栏与网页加载进度条优化.pdf

实现的效果:标题栏显示网页标题并且滚动,并且用进度条显示网页的加载进度(重新定

义标题栏,lephone修改后的都带有一个返回按钮,并且标题文本和进度条是Frame布

局的不太好看)。

1、首先定义一个RelativeLayout布broser_custom_title.xml

(AlwaysMarqueeTextView这个类重写了TextView,实现一个灯的效果,网上能够找到)

:

XML/HTML代码

1.?xmlversion1.0encodingutf‑8?2.RelativeLayoutx

mlns:android

android:layout_widthfill_parent3.android:layout_heightfill_parent4.

com.android.CustomTitleTest5.android:id@+id/tvtitle6.

android:layout_widthfill_parent7.android:layout_heightwrap_content8.

android:focusableInTouchModetrue9.android:singleLinetrue10.

android:ellipsizemarquee11.android:focusablefalse12.

android:marqueeRepeatLimitmarquee_forever13.android:textSize20sp

==

android:layout_centerVerticaltrue/14.ProgressBar15.android:id@+

id/pb16.android:layout_widthfill_parent17.android:layout_height

wrap_content18.style?android:attr/progressBarStyleHorizontal19.

android:visibilitygone20.android:layout_alignParentBottomtrue21./

ProgressBar22.23./RelativeLayout

代码

2、继承WebChromeClient,重写onProgressChanged和onReceivedTitle

(进度条加载完成后使用动画渐退)

文档评论(0)

1亿VIP精品文档

相关文档