You can use a shape drawable defined in XML....  Perhaps something like
this:

<?xml version="1.0" encoding="utf-8"?>
<shape
     xmlns:android="http://schemas.android.com/apk/res/android";
     android:shape="line">
     <stroke
          android:width="2dp"
          android:color="#19191f"
          android:dashWidth="5dp"
          android:dashGap="3dp" />
</shape>

Note that I have not tested this, so some tweaking may be required... But
if you use this method you shouldn't have to do any sort of calcuation to
compute the width of your drawable.

You would use this like any other drawable... So, if you put the above code
in a file called "res/drawable/dashed_separator.xml" then you would access
it like so:

   - Code: R.drawable.dashed_separator
   - XML: @drawable/dashed_separator

Hopefully that will help...
Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Wed, Aug 29, 2012 at 6:28 AM, Pau Rodríguez Coloma <paro...@gmail.com>wrote:

> Thanks sparky, but what I want is to stretch only for round the final
> number of repetitions. I want a repetition of: small line - space - small
> line - space - …
>
> An effect like this: -  -  -  -  -  -  -  - (with a custom designed line).
> The problem is with the last line, sometimes it appears cropped because for
> fill the size of the ImageView I need a not natural number of repetitions,
> in this case a want to stretch all small lines and spaces in order to have
> a natural number of repetitions.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to