如何从Java文件更改字体大小和字体颜色? [英] How do change the font size and font color from a Java file?
本文介绍了如何从Java文件更改字体大小和字体颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从Eclipse中的Java文件而不是XML文件更改字体颜色,大小和按钮颜色?
How can I change the font color, size and button color from a Java file in Eclipse, not from an XML file?
推荐答案
对于字体大小,您可以将其写为
For font size you can write it as
tv.setTextSize(20.0f);
对于字体颜色,您可以将其写为
For font color you can write it as
tv.setTextColor(Color.BLUE);
对于按钮背景颜色,您可以将其写为
For button background color you can write it as
btn.setBackgroundColor(Color.CYAN);
这篇关于如何从Java文件更改字体大小和字体颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文