I want to create a custom seek-bar. Along with other resources I have followed this two examples:
http://developer-dot-android.blogspot.ro/2012/03/custom-seekbar-tutorial.html
http://www.mokasocial.com/2011/02/create-a-custom-styled-ui-slider-seekbar-in-android/
http://code.google.com/p/android-apktool/wiki/9PatchImages
All what I have tried crash at this line:
........
<nine-patch
xmlns:android="http://schemas.android.com/apk/res/android"
android:dither="true"
android:src="@drawable/whitepatch">
</nine-patch>
with:
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #5: <nine-patch> requires a valid 9-patch source image
04-16 15:46:45.242: E/AndroidRuntime(20508): at android.graphics.drawable.NinePatchDrawable.inflate(NinePatchDrawable.java:320)
04-16 15:46:45.242: E/AndroidRuntime(20508): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:881)
04-16 15:46:45.242: E/AndroidRuntime(20508): at android.graphics.drawable.LayerDrawable.inflate(LayerDrawable.java:165)
.....
I have tried to generate my own 9-patch images using draw9patch.bat
tools from sdk as described here. (without any other workaround because I don't know how, just import the .png
and then save it as .9.png
).
I have try to copy/paste the whitepatch.9.png
used in the first tutorial, into my project.
Same result. I really don't know what to do with this. Please help me!