Hi, To achieve this you'll have to compute the size of your drawable and set it to be a multiple of the size of your PNG. You can set the bounds of a drawable by calling setBounds(). Note that a View's background drawable always gets the size of the View itself. This means you could also simply set the View's size to be a multiple of the size of your PNG.
On Wed, Aug 29, 2012 at 3:16 AM, Pau Rodríguez Coloma <[email protected]> wrote: > Hi, > > I'm developing an app and I want to put a separator between sections in the > UI. Imagine a form, I want to make a visual separation between diferrent > kinds of data. The designer idea is to put an horizontal discontinuous line. > So I'm using a png file as a source of bitmap xml resource with > tileMode=repat in order to put this bitmap as a background of a Layout or as > a source of ImageView. > > The screen width is different depending of the device, so the number of > times that the system repeats my png is different at each device. This is > not a problem for me, the problem is when the number of repetitions is not a > natural number, for example 23.3 times. The result of this is that the last > line appears cropped and it don't look ok. What I want is that in this case, > the system don't makes 23.3 repetitions, instead of this I want 23 or 24 > repetitions stretching the png. Is it possible? > > Does anyone know how can I do this? > > > Thanks in advance. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer [email protected] -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

