更改单选按钮旁边的文本字体? [英] Change font of text next to radio button?

查看:86
本文介绍了更改单选按钮旁边的文本字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要更改我使用的textView的字体

To change the font of a textView I used

TextView tv = (TextView) findViewById(R.id.textview);
Typeface font = Typeface.createFromAsset(getAssets(), "SF_Cartoonist_Hand_Bold.ttf");
tv.setTypeface(font);

我想对单选按钮旁边的文本执行类似的操作,我该怎么做?

I want to do something similar for the text next to a Radio Button, how do I go about doing that?

推荐答案

您可以将字体设置为RadioButton旁边的文本,方法与对TextView一样:

You set the font to the text next to a RadioButton the same way you do to a TextView:

RadioButton rb  = (RadioButton) findViewById(R.id.radiobutton);
Typeface font = Typeface.createFromAsset(getAssets(), "SF_Cartoonist_Hand_Bold.ttf");
rb.setTypeface(font);

这篇关于更改单选按钮旁边的文本字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆