• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps how setup the font size of text in a Button

lse123

Member
Nov 19, 2010
72
0
how setup the font size of text in a
HTML:
<?xml version="1.0" encoding="UTF-8"?>
<Button xmlns:android="http://schemas.android.com/apk/res/android"
   android:id="@+id/newGuessButton" android:layout_weight="1"
   android:layout_width="wrap_content" 
   android:layout_height="wrap_content"></Button>
 
void setTextSize(float size)
Set the default text size to the given value, interpreted as "scaled pixel" units.
void setTextSize(int unit, float size)
Set the default text size to a given unit and value.

yes i saw but DEFAULT is sp units? if set a unit i supposed to use
void setTextSize(COMPLEX_UNIT_PX, 10)
void setTextSize(COMPLEX_UNIT_SP, 10)
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones