2
我正在使用xml文件来定义进度条。 我在背景形状上定义了填充。但是这种设置有时可以正确显示,有时不会显示。 所以,如果我用里面的进度条启动我的应用程序或活动,将会正确显示带有背景和“填充”进度的进度条。然后我关闭我的应用程序,并再次启动,并且,进度条显示没有填充背景,在下一次启动将正确显示和儿子... 你能请咨询可能的原因呢?填充进度条中的形状
XML文件:
<item android:id="@android:id/background" >
<shape>
<corners android:radius="15dip" />
<padding
android:left="1dp"
android:top="6dp"
android:right="1dp"
android:bottom="6dp"
/>
<solid
android:color="#00000000" />
</shape>
</item>
<item android:id="@android:id/progress" >
<clip android:clipOrientation="horizontal" android:gravity="left" >
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="15dip" />
<stroke
android:width="1px"
android:color="#ffffffff"
android:dashWidth="2px"
android:dashGap="0px"/>
<solid
android:color="#ff0000ff" />
</shape>
</clip>
</item>