ProgressBar the Indeterminatedrawable attribute on Android 6.0 issue

Source: Internet
Author: User

To define the ProgressBar method by using the Indeterminatedrawable property:

    <ProgressBar        android:id="@+id/pb"        android:layout_width="30dp"        android:layout_height="30dp"        android:layout_centerVertical="true"        android:indeterminateDrawable="@drawable/loading" />

There are several ways in which the loading.xml can be:

1.animation-list, consisting of a bunch of continuous images:

<?xml version= "1.0" encoding= "UTF-8"?>  <animation-list android:oneshot="false"xmlns:android="http// Schemas.android.com/apk/res/android ">        <item android:duration=" android:drawable="@drawable/load _1 " />    <item android:duration=" " " android:drawable="@drawable/load_2 " />    <item android:duration=" android:drawable="@drawable/load_3 " />    <item android:duration=" android:drawable="@drawable /load_4 " />    <item android:duration=" " " android:drawable="@drawable/load_5 " />    <item android:duration=" android:drawable="@drawable/load_6 " />    <item android:duration=" android:drawable="@drawable /load_7 " />    <item android:duration=" " " android:drawable="@drawable/load_8 " />  </animation-list> 

2.layer-list/rotate, the continuous rotation of a picture is achieved by:

<?xml version="1.0" encoding="utf-8"?

> <layer-list xmlns:android="Http://schemas.android.com/apk/res/android" > <item> <rotate android:drawable="@drawable/loading" android:fromdegrees= "0.0" android:pivotx="50.0%" android:pivoty="50.0%" android: Todegrees=" /> " </Item> </layer-list>

3. Define a circular shape and color rotation:

<rotate  xmlns:android       = "http://schemas.android.com/apk/res/android"  android:fromdegrees  = "0"  android:pivotx  =  Android:pivoty  = "50%"  android:todegrees  = "the" ;       <shape  android: Innerradiusratio  = "3"  android:shape  =< Span class= "Hljs-value" > "ring"  android:thicknessratio  =" " android:uselevel  =" false "
     ;           <gradientandroid:centercolor= "#FFFFFF"android:centery="0.50"  Android:endcolor="#1E90FF"android:startcolor= "#000000"android: Type="Sweep"android:uselevel="false" />                                                                                          </shape>  </rotate>

In the use of the process found that the first form in 6.0 below the system perfect execution, but in 6.0 and above the system can not be displayed, if you encounter this problem can choose other ways to do! The reason for not showing is unknown. It could be a 6.0 bug.

。。

ProgressBar the Indeterminatedrawable attribute on Android 6.0 issue

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.