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?
Step 1: Create a wx. Font object. Step 2: Add different attributes of font in parameters like: family, style etc. Step 3: Create a Radio Button.
To select a radio button by clicking on its text in React:Add a label element for each radio button. The htmlFor prop of each label should be set to the id of each radio button. Click on the label element to select the radio button.
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);
From the official doc:
Typeface typeface = getResources().getFont(R.font.myfont);
textView.setTypeface(typeface);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With