Android Question How to make a button the way they often are

Martincg

Member
Licensed User
Longtime User
I am defeated by simple buttons!

If I place a button on a panel and make the top 0 and the left 0 then there is always a border around the button showing the parent panel which I don't want.
I can use a label but labels don't seem to respond to touch so that I cannot change the colour when it's pressed, although I can use a click event.

Panels behave the way I want but they don't have a text field.

So I'm using a panel, then a label, then a transparent panel over the label and I can respond the the panel touch, change the label colour on ACTION_DOWN/ACTION_UP and treat up or down as click.
I find it difficult to believe this is what everyone does.

How should I do it and what am I missing?
 

Martincg

Member
Licensed User
Longtime User
Thanks.

I don't know what statelistdrawable is yet, but don't tell me, I want to find out myself - it's better for my learning.

Cheers

Edit.
I see, it's obvious of course. Ah well, at least I'm not so stupid now as I was 10 minutes ago.
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I need to do a circle button with a picture, how can i do?
Better start a OWN thread for your issue instead of hijacking other threads which has nothing in common with your issue.
You can also USE the forum search: Search the forum!
 
Last edited:
Upvote 0
Top