2016-08-08 6 views
0

画像でプログレスバーを変更するにはどうすればよいですか?私はそれのように見えるようにしますthis ほぼすべての水平の長さを取ることが欲しいです。image xamarinを使用して水平方向のプログレスバーを作成するandroid

私はこの結果にhttp://www.bellaterreno.com/graphics/biz_processingbar/processingbar_blue_diagonal_sm_ani.gif

+2

歓迎で見つけることができます。これまでに何を試してみましたか? –

答えて

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/

公式ドキュメントはStackOverflowのためにhttps://developer.xamarin.com/guides/xamarin-forms/custom-renderer/

関連する問題