【发布时间】:2016-07-18 20:12:20
【问题描述】:
我正在尝试创建一个不确定的进度条来表示在我的应用程序中加载。然而,在尝试了无数的 xml 布局和不同的代码之后,我似乎无法得到任何工作。这是我的主要片段的 xml 文件:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.dwinnbrown.xxx.FirstFragment">
<!-- TODO: Update blank fragment layout -->
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<ProgressBar
android:id="@+id/prgrsbar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:max="500"
android:progress="0"
android:indeterminate="true"
android:progressDrawable="@drawable/circular" />
</FrameLayout>
还有我的 circular.xml 文件:
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="7.0">
<gradient
android:centerColor="#007DD6"
android:endColor="#007DD6"
android:startColor="#007DD6"
android:angle="0"
android:type="sweep"
android:useLevel="false" ></gradient>
</shape>
但是输出看起来像这样 - 我错过了什么吗?
【问题讨论】:
标签: android xml android-progressbar