About 5,100,000 results
Open links in new tab
  1. How to Change Button Font in Android? - GeeksforGeeks

    Jan 30, 2022 · A text can be set inside the button to name it. However, this text can be seen in a particular font only which is set by default. So in this article, we will show you how you could change the Button text font in Android. Follow the below steps once the IDE is ready. Step by Step Implementation. Step 1: Create a New Project in Android Studio

  2. Setting Button text font in android - Stack Overflow

    Jun 16, 2011 · First you have to put the ttf file in assets folder and then You can use the below code to set Custom font in TextView, same way you can do for Button: TextView txt = (TextView) findViewById(R.id.custom_font); Typeface font = Typeface.createFromAsset(getAssets(), "Helv Neue 67 Med Cond.ttf"); txt.setTypeface(font);

  3. How to set a particular font for a button text in android?

    Dec 22, 2016 · import your font file (copy your font file (Copperplate Gothic Light.ttf) from where you have downloaded it or if its windows font to assets folder) inside your project. Then you add this lines of code when you create a button in code, or refer to it by finditbyid.

  4. How to change the text of a Button widget in Android?

    Oct 3, 2010 · Just be sure to add import android.widget.View; at the top of your java file. If you also add import android.widget.Button;, it can be shortened to: ((Button)findViewById(R.id.yourButtonName)).setText("New Text"); You can use the setText() method. Example:

  5. How to add Custom Fonts in Android - GeeksforGeeks

    Apr 23, 2024 · There are majorly three methods to add custom fonts to text in Android Studio. The first two methods involve the use of the Typeface class while the last method is quite direct and easy. Follow the entire article to explore all the methods.

  6. How to set a particular font for a button text in Android?

    This example demonstrates how do I set a particular font for a button text in android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml.

  7. Styling Button and Text using Style Attribute in Android

    Dec 29, 2021 · In this article, we are going to show styling on a button and text without the use of any drawable file or without using any library. Here we are going to use the style attribute to change the layout of the button in just one line of code.

  8. How to Change The Font on Android Studio - PassGap

    Aug 6, 2023 · While Android Studio does not provide a direct option to change the font, there are various methods available, such as modifying the editor font, using plugins, or creating custom themes. Experiment with different methods and fonts to find the one that suits your coding style.

  9. Kotlin Android Button – Text - Tutorial Kart

    To set Android Button text, we can assign android:text XML attribute for Button in layout file with the required Text value. To programmatically set or change Android Button text, we can pass specified string to the method Button.setText(new_string_value).

  10. Android button font size - Stack Overflow

    May 13, 2010 · Every time you click your button, Button text will be change (+2px size). You can add another button and change size -2px too. If you want to save size for another openings, you may use Shared Preference interface.

Refresh