Android, view button. The button size is 38x38dp, the text size is 20dp (just one character of text + ). Gravity set to center | center_vertically.
The text is not centered vertically. According to Android's internal accounting, the text is too large for the specified button size, so the text is placed with its top alignment with the top indent, and its bottom off. This is not what I want; I want the text to be cut evenly on top and bottom. In other words, vertically centered. A plus symbol, since it takes up less than a full-sized symbol cell, will not suffer from this.
This is the Gravity that I set, not Layout gravity . I know the difference.
Any ideas on how to make vertical centering work under such conditions, with the exception of overriding draw ()?
source share