How to draw Line with rounded corners in Android xml drawables -
i want draw line in xml
rounded corners.i not getting how create that.i want use line seekbar
. want give rounded corners line rectangle.
<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape android:shape="line"> <stroke android:width="5dp" android:color="#7b7878" /> </shape> </item> <item android:id="@android:id/progress"> <clip> <shape android:shape="line"> <stroke android:width="5dp" android:color="#ff0000" /> </shape> </clip> </item>
you can this
//seek_bar.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" android:drawable="@drawable/seek_bar_background"/> <item android:id="@android:id/progress" android:drawable="@drawable/seek_bar_progress" /> </layer-list> //seek_bar_background.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <gradient android:angle="270" android:startcolor="#8a8c8f" android:endcolor="#58595b" /> <corners android:radius="5dip" /> </shape> //seek_bar_progress.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" android:drawable="@drawable/seek_bar_background"/> <item android:id="@android:id/progress"> <clip android:drawable="@drawable/seek_bar_progress_fill" /> </item> </layer-list> //seek_bar_progress_fill.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <gradient android:startcolor="#b3d27e" android:endcolor="#93c044" android:angle="270" /> <corners android:radius="5dip" /> </shape>
Comments
Post a Comment