开发者

How to change the button fontsize without changing button size (in android)?

I need to have a grid (created by program, not by 开发者_如何转开发xml) of equally sized buttons. They display text in different sizes. The problem is that when I change the text size to a smaller size, then the button automatically resizes to be smaller than the others.

Thanks,

Note: the grid is created adding TableRows of buttons to a TableLayout. The buttons are created and added to a TableRow

tr.addView(bu, 36, 45);


Adding padding (setPadding()) will expand the button while keeping the font size small. Figuring out how much padding to add, though, is up to you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜