2017-04-12 9 views
1

Hier ändern Sie den Code ich brauche, ist die Farbe des progressbar Spinner oder LaderWie Spinner Android Progressbar Farbe

die Farbe Ich habe versucht, Stil hinzugefügt haben zu ändern
<android.support.constraint.ConstraintLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.conceptchest.conceptchest.mainConcept"> 

    <WebView 
     android:id="@+id/mainWebView" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_constraintRight_toRightOf="parent" 
     app:layout_constraintLeft_toLeftOf="parent" 
     app:layout_constraintBottom_toTopOf="@+id/progress1" 
     app:layout_constraintTop_toTopOf="parent" /> 

    <ProgressBar 
     android:id="@+id/progress1" 
     aenter code herendroid:layout_centerHorizontal="true" 
     android:layout_centerVertical="true" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     app:layout_constraintRight_toRightOf="parent" 
     app:layout_constraintLeft_toLeftOf="parent" 
     app:layout_constraintBottom_toBottomOf="parent" 
     app:layout_constraintTop_toTopOf="parent" 
     /> 


    /> 
    </android.support.constraint.ConstraintLayout> 

Bitte helfen, da ich nicht in der Lage zu ändern und seine nicht

+1

possibe Duplikat http://stackoverflow.com/questions/5337613/how-to-change-color-in-circular-progress-bar – Lokesh

+0

Ich habe versucht, dass auch –

+0

Geben Sie uns Ihren aktualisierten Code. – Lokesh

Antwort

0

Arbeits Das ist mein Problem gelöst How to change color in circular progress bar?

Mein aktueller Code ist

 <ProgressBar 
      android:id="@+id/progress1" 
      android:layout_centerHorizontal="true" 
      android:layout_centerVertical="true" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      app:layout_constraintRight_toRightOf="parent" 
      app:layout_constraintLeft_toLeftOf="parent" 
      app:layout_constraintBottom_toBottomOf="parent" 
      app:layout_constraintTop_toTopOf="parent" 
      android:background ="@xml/progress" 
      /> 
0

Programmatically Ihre Fortschrittsbalken verfärben sich wie folgt aussehen:

ProgressBar spinner = new android.widget.ProgressBar(getApplicationContext(), null, android.R.attr.progressBarStyle); 
    spinner.getIndeterminateDrawable().setColorFilter(Color.parseColor("#FF0481"), PorterDuff.Mode.MULTIPLY);