在FrameLayout中添加ProgressBar标签和TextView标签,都是居中显示,在TextView中的text属性中动态改变值,可以写出进度条的显示效果
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--其中的ProgressBar的style是进度条的样式,前面的?android:attr/写完后,里面可以选择-->
<ProgressBar
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyle"/>
<TextView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="80%"/>
</FrameLayout>