In a kind of status panel for my app I was using labels to display various settings but also want to allow the user to tap on any of the individual setting displays to change it. I was using labels to display the settingssSo my first thought was to replace the labels with buttons and simply change the button text as the setting changes. However I discovered that if I used the same textsize for the button text as I had for the labels it didn't fit within the same button size. So I would have to make the buttons bigger or the text smaller (at least 3 points smaller) but neither of these options are ideal to maintain the layout and readability of the screen.
So my question is first: why is the text margin within buttons greater than that within labels and can it be changed. And second is there any other way of achieving this with a combination of labels and buttons?
The standard visible part of buttons is smaller than the whole size.
Bur you can change the button background.
In the Designer change the Drawable property from DefaultDrawable to StatelistDrawable and select ColorDrawable and you can set different colors for different states and set the corner radius.
Thanks for the suggestion but I don't think that will resolve the issue. Even if I were to use colors to show the say On/Off status of a setting (eg, green for on and red for off) I still need to display the status name and that means I need a larger textsize than I can fit within the buttons.
Is it possible to have a button hidden behind a label and still have it active?
I suggested you to change the button background to ColorDrawable because in that case the button dimensions are 'full size' the same as a Label with the same outer dimensions.