I've seen it done for fixed size buttons entirely in XML just by using
FrameLayout, which overlaps all its children. Inside the FrameLayout
you put the button and another layout with the content, then tweak the
sizes/padding/margins such that the content looks like it is in the
button when really it is above the button. The content isn't
clickable, so touching it touches the button behind it. If I had to do
a content sized one and couldn't figure out how to do it entirely in
XML, I'd probably still steal the same approach, I'd just set the size
of the button via code after the layout is sized to the content. That
doesn't require any code merging, just managing the size of a button
child in a custom layout subclass.

On Sep 3, 9:02 am, Zsolt Vasvari <[email protected]> wrote:
> Before I go down the difficult path of merging some button and
> relative layout code, I wanted to ask if there was an easy way to
> group a set of controls as a focusable, clickable button?  My educated
> guess is no...
>
> I have 3 text labels of various attributes (font size) which I would
> like to put on a button.  Having HTML text *may* work, but I would
> lose all the niceties of styles and layout alignments.
>
> Any other solution anybody can think of?

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