如何用圖片更改進度條?我想它看起來像 我希望它幾乎取所有的水平長度。使用圖片製作水平進度條xamarin android
我想這個結果http://www.bellaterreno.com/graphics/biz_processingbar/processingbar_blue_diagonal_sm_ani.gif
如何用圖片更改進度條?我想它看起來像 我希望它幾乎取所有的水平長度。使用圖片製作水平進度條xamarin android
我想這個結果http://www.bellaterreno.com/graphics/biz_processingbar/processingbar_blue_diagonal_sm_ani.gif
您可以設置自定義進度欄創建在資源管理>文件夾繪製一個額外的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/
歡迎搜到計算器。你試過什麼了 –