views:

1035

answers:

2

Hi

I would like to create a custom button with framed caption in right top corner. Looks like it requires to use overlays, but it is available only for map view.

Button should work following way: 1. User clicks on button. 2. Button behaves as an usual button, so we see that it is focused, pressed or has normal state depending on what is currently performed. 3. The caption in right top corner doesn't change.

So, do you have any ideas how this can be implemented? Possibly, to override onDraw method, but may be there will be better approaches.

Thanks, Lyubomyr

+2  A: 

Don't put the caption as part of the button. Put the caption above the button, using RelativeLayout to control its X/Y position. By making the caption be the second child of RelativeLayout (button being first), the caption will be higher on the Z axis and appear to float above the button.

CommonsWare
A: 

Thanks for the good idea.