For several of the buttons in my app I need to calculate and vary the textsize based on the actual button text. In the designer script I have set the button size and default textsize and set the text alignment to CENTER_HORIZONTAL and the button Drawable property to ColorDrawable. Later in the app I recalc the textsize using MeasureMultilineTextHeight. When I run this on a 320 x 480 screen (which is the layout variant I use) in one case the textsize is 18 and the button height is 24 but the text is not centered within the button so that the bottom edge of it is missing.
I recall that in a previous post someone informed me that when the Drawable property was set to ColorDrawable the inner margin would be the same as for a label. However, when I change the button to a label with the same properties the text displays perfectly. What am I missing this time?
Ta
I recall that in a previous post someone informed me that when the Drawable property was set to ColorDrawable the inner margin would be the same as for a label. However, when I change the button to a label with the same properties the text displays perfectly. What am I missing this time?
Ta