Equally distributed icons in an Android Progressbar -
i'm trying sound easy implement. however, doesn't respond expected. i'm using progressbar
draw 5 state bar, user can click on of states change behavior of application. progressbar uses drawable (just pay attention background
element).
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@android:id/background"> <nine-patch xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/statusbar_thin" /> </item> <item android:id="@android:id/secondaryprogress"> <clip> <shape> <gradient android:endcolor="#ffeeeeee" android:startcolor="#ffeeeeee" /> </shape> </clip> </item> <item android:id="@android:id/progress"> <nine-patch xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/statusbar_thin" /> </item> </layer-list>
this @drawable/statusbar_thin
.
you may see don't vertically centered spots, doesn't matter. problem that, when image stretched (it's 9 patch, may expect), "superior black mark expands pixels below it" (i don't know how it's called. anyone?) expands them randomly (by mean parts expand twice more others).
i'm not sure if there's trick didn't use, or it's android uses indistinctly block, instead of of them evenly. ideas on that?
edit:
as @sandkasten suggested, used draw9patch application. however, see, looks distributed, on nexus 7, doesn't work.
edit 2:
the status bar in black background. see, there's big distance between first , second icon, while selector inbetween.
edit 3: such amazing world. started playing top black marks, and, despite weren't equally distributed @ last, worked.
if understand right, should solution. take @ draw9patch.bat, shows preview of image , how android strech it. it's deliverd android sdk.
Comments
Post a Comment