Paolo,

Yes, using a nine-patch drawable background is easy, efficient, and produces great results.

Try this: open a layout in XML mode and add this attribute:

android:background="@android:drawable/toast_frame"

Think you'll like it :)

-- Kostya

16.12.2010 13:24, Paolo пишет:
ah... and using nine-patch drawable is better than the way I'm
following? Why should I prefer this way? I'm asking just to
understand :)

On 16 Dic, 11:16, Kostya Vasilyev<[email protected]>  wrote:
Just use android:background with a nine-patch drawable. No need to subclass.

You can even copy one of Android's nine-patch backgrounds into your project.

Take a look inside the Android SDK directory, then
platforms\android-X\data\res\drawable-mdpi (-hdpi).

There are some very nice one in there, in particular toast_frame.9.png,
zoom_plate, panel_background, etc.

-- Kostya

16.12.2010 13:03, Paolo пишет:





Because I'd like to draw something similar to this.
http://pocketjourney.files.wordpress.com/2008/03/goal.gif?w=500
On 16 Dic, 10:53, Zsolt Vasvari<[email protected]>    wrote:
Why would you need to extend RelativeLayout just to change the
background?
On Dec 16, 5:36 pm, Paolo<[email protected]>    wrote:
Hi!
I'm trying to customize a RelativeLayout on order to show a nice
trasparent black content box. So my class has extended RelativeLayout
and has overridden the onDraw() method, but nothing appears in the
Eclipse layout editor; the same happens if I try to run my app on the
device.
I read I have to override dispatchDraw() and this works. I can see my
custom layout in the editor, but I'm not able to add child view to the
layout. Or better... I add a child in my layout from XML, but I can't
see it on the Eclipse layout editor. In this case if I run the app on
the device I see my layout drawn not correctly.. only a part of it is
drawn or it appears cut.
Why? What am I wrong?
--
Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com


--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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

Reply via email to