Using the button control of Android, the size of the text and the height of the button are almost the same. If you want the text in the button to be centered in the vertical direction, how to set it?
Button is set as follows in the layout file
The layout that contains it is
<RelativeLayout android:layout_width="match_parent" android:layout_height="30px">
Of course, I tried to put it in LinearLayout, or when I was looking for solutions online, I said that relativelayout could be used to solve the problem. However, after trying, I found that the problem was still the same.
It is shown as follows:
The font is never centered, but away from the top edge of the button control.
Guess if the button control limits the minimum value of paddingtop? How to realize the text in button to be centered vertically?