2016-08-08 61 views

回答

0

您可以設置自定義進度欄創建在資源管理>文件夾繪製一個額外的XML。創建progressbar.xml文件並使用您自己的樣式對其進行自定義。它應該看起來類似於此:

<?xml version="1.0" encoding="utf-8"?> 
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> 

    <!-- Define the BACKGROUND properties: colors, gradient, etc --> 
    <item android:id="@android:id/background"> 
    <shape> 
     <gradient 
       android:startColor="#000001" 
       android:centerColor="#0b131e" 
       android:centerY="1.0" 
       android:endColor="#0d1522" 
       android:angle="270" /> 
    </shape> 
    </item> 

    <!-- Define the PROGRESS BAR properties: colors, gradient, etc --> 
    <item android:id="@android:id/progress"> 
    <clip> 
     <shape> 
      <gradient 
       android:startColor="#007A00" 
       android:centerColor="#007A00" 
       android:centerY="1.0" 
       android:endColor="#06101d" 
       android:angle="270" /> 
     </shape> 
    </clip> 
    </item> 
</layer-list> 
In your AXML file you have to define 'android:progressDrawable': 

<ProgressBar 
    android:progressDrawable="@drawable/progressbar" 
... 
/> 

基於此stackoverflow後。 How to Customize a Progress Bar In Android

或與Xamarin

此信息您可以做到這一點使用自定義呈現。

Xamarin的James Montemagno對創建自定義圓形進度條有很好的指導。在Xamarin.Forms自定義渲染

https://blog.xamarin.com/using-custom-controls-in-xamarin-forms-on-android/

官方文檔可以在https://developer.xamarin.com/guides/xamarin-forms/custom-renderer/