tags:

views:

160

answers:

2

I have been looking for a easy way to add borders to custom made Views (Compounds or whatever), and the only answer I found was that there is no built-in support for that. Instead there are suggestions that you should add Views on top/below the View you want borders on and a bunch of others really messy ways to get borders.

Coming from the .NET-environment that is pretty brutal to have to do ugly workaround and "hacks" to get something as simple as borders.

Thus, I want to suggest that feature to the Android team. Im not sure how they can have missed it, but it is surely missed =)

So, is there any official way to suggest a feature in the SDK/framework? I have looked around a bit, but cant comment on their blogs, no e-mail addresses as far as I can see...

Regards

+2  A: 

Put your suggestion at google code.

Ngu Soon Hui
I have done this and they really do pay attention and do stuff with comments and suggestions.
Philip Schlump
+1  A: 

You can easily create a Drawable subclass that draws whatever border you want and reports the padding for that border, and sets it as the background of the view you want to have drawn with a border. Or set it on a FrameLayout to have the border placed around the other views inside of the frame.

hackbod
Btw the platform almost always defines borders as 9-patch drawables.
hackbod
Hey, thx for the answer. I know about the Drawable approach. I find that very messy to. Why not just include a border property as usual? I think it is just weird they didnt include that support by default. I tried the Drawable approach, didnt get it to work nicely which sort of proves my point: it's messy =(.
Ted
hackbod: yes, I know about that too. Thats, as I see it, one of those "bunch of messy stuff" to do it. To create a 9-patch image for just getting a border? Horrible approach Id say =( Thx for the answer though =)
Ted
What kind of border are you looking for? If you just want a blah rectangular border, no, there isn't a super-easy way to do that because... honestly, no real application that looks decent is going to want to do that. But for actual design borders, it is very easy -- define it as a drawable, either as a 9-patch or a shape. I'm sorry you had trouble making a 9-patch drawable, but once you understand it, it is really not that hard. There are a zillion examples of them in the Android resources because pretty much all of the frames and borders and such in the standard UI are built that way.
hackbod
Hello =) Why wouldnt that look "decent"? Im guessing it would look like a line around the View, just as one would expect from a border? =)
Ted