Thanks to all for your help. The "problem" (but not a critical problem) is 
that if I use a png file for the background I need at least 4 files for 
ldpi, mdpi, hdpi and xhdpi in order to have the same separation between 
lines. And also I think that if I use shapes instead of png I could have 
better performance with quality and RAM (but I'm not sure about it, it's 
only an idea that I want to check).

I was trying to make a shape with the dark rectangle and only one light 
line from bottom-left corner to top-right corner, with the idea to use this 
shape in a bitmap xml drawable resource with tileMode=repeat. But the 
problem with this approach is that when I use this like the background of 
the RelativeLayout it fills all the space and no makes repetitions. I was 
testing with use of width and height but the result is the same.

Does anyone have a idea? At the moment this is not only a necessity it is 
also a personal challenge.

Thanks in advance. 

El martes, 28 de agosto de 2012 23:11:02 UTC+2, bob escribió:
>
> Why not extend android.widget.RelativeLayout and implement your own onDraw 
> method?  
>
>
>
> On Friday, August 24, 2012 5:08:54 AM UTC-5, Pau Rodríguez Coloma wrote:
>>
>> Hi, 
>>
>>  I'm want to set the background of a RelativeLayout like the attached 
>> png. For the moment I'm using a bitmap definition xml named 
>> "background_dark.xml" like:
>>
>>
>> <?xml version="1.0" encoding="utf-8"?>
>>
>> <bitmap xmlns:android="http://schemas.android.com/apk/res/android";
>>
>>     android:src="@drawable/fondo_oscuro"
>>
>>     android:tileMode="repeat">
>>
>> </bitmap>
>>
>>
>> And using it as the background drawable in my RelativeLayout: 
>>
>>
>> <RelativeLayout
>>
>>     android:layout_width="fill_parent"
>>
>>     android:layout_height="fill_parent"
>>
>>     android:layout_below="@+id/headerLayout"
>>
>>     android:background="@drawable/background_dark">
>>
>> </RelativeLayout>
>>
>>
>> But I want to make the same effect without using the png file, i.e. using 
>> only shapes and layer-list. The number of lines has to be different 
>> depending of the screen size, only the separation between lines are 
>> determinated.
>>
>>
>> Does anyone know how can I do this?
>>
>>
>> Thanks in advance. 
>>
>>
>> NOTE: Sorry about my english.
>>
>

-- 
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