Circular ProgressBar Hintergrund: Android Xamarin

Habe ich eine kreisförmige Fortschritt-bar und es funktioniert gut.Aber Hintergrund ist nicht angezeigt, obwohl ich die Form für den "hintergrund" in der drawable xml-Datei und auch der Fortschritt beginnt von der rechten Seite des Kreises (wie in der Abbildung gezeigt). Ich will es, um es von der Spitze.

Circular ProgressBar Hintergrund: Android Xamarin

Hier ist mein code:

 <ProgressBar
        android:id="@+id/progressBarToday"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="50dip"
        android:layout_height="50dip"
        android:layout_centerInParent="true"
        android:indeterminate="false"
        android:max="60"
        android:progress="0"
        android:progressDrawable="@drawable/progressbar" />

progressbar.xml

    <?xml version="1.0" encoding="UTF-8" ?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@android:id/background"> <---not working!
    <shape
        android:innerRadiusRatio="3"
        android:shape="ring"
        android:thicknessRatio="7.0">
        <solid android:color="@color/red"/>
        </shape>
    </item>
    <item android:id="@android:id/progress">
    <shape
        android:innerRadiusRatio="3"
        android:shape="ring"
        android:thicknessRatio="7.0">
        <solid android:color="@color/blue"/>
        </shape>
    </item>
    </layer-list>

Ich benutze folgenden code, um die Fortschritte:

    ProgressBar pb = (ProgressBar)FindViewById (Resource.Id.progressBarToday);  
    _progressBar.Progress = _progressCount;

Warum der hintergrund nicht angezeigt wird? und Wie kann ich den Fortschritt machen, den start von oben?

Bitte jemand helfen, Danke.

Wo definierst du progressBarStyleHorizontal?

InformationsquelleAutor Erma Isabel | 2014-03-26

Schreibe einen Kommentar