atom feed1 message in [android-developers] Re: Horizont...
FromSent OnAttachments
Romain GuyFeb 22, 2008 3:21 pm 
Subject:Re: [android-developers] Re: Horizontal Rule View (straight line)
From:Romain Guy (
Date:Feb 22, 2008 3:21:28 pm

View ruler = new View(myContext); ruler.setBackgroundColor(0xFF00FF00); theParent.addView(ruler, new ViewGroup.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, 2));

On Fri, Feb 22, 2008 at 2:55 PM, conlan <> wrote:

Any suggestions on doing that programmatically? I could use an AbsoluteLayout? But I'd have to provide a fixed number for the width.

I'd like to be able to provide "fill_parent" for width and "1px" for the height.


On Feb 22, 2:32 pm, conlan <> wrote:

Thanks Romain.

On Feb 22, 11:56 am, "Romain Guy" <> wrote:


Just use a View, give it a fixed height with android:layout_height and a background color with android:background. Like this for instance:

<View android:layout_width="fill_parent" android:layout_height="2dip" android:background="#FF00FF00" />

On Fri, Feb 22, 2008 at 11:49 AM, conlan <> wrote:

I'm looking for a component I can add to my layouts that's just a straight horizontal or vertical rule that I can choose the color


Currently, I have a custom view that just draws a line but is there anything in Android that I can use?