I am developing an application and would like to know if it is possible to increase the default font of Android? From medium to large. And if it is, is it complex? I tried with TextAppearence.Large as style but I could not.
I am developing an application and would like to know if it is possible to increase the default font of Android? From medium to large. And if it is, is it complex? I tried with TextAppearence.Large as style but I could not.
You can set the font size beyond the android:textAppearance
property, using this, android:textSize
Example:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="50sp"/>
You'd better put your code here to see possible errors in your code.
But do the following test, in your main style put the item TextSize
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:textSize">@style/TextSize</item>
</style>
Create the TextSize style defined above
<style name="TextSize">
<item name="android:textSize">20sp</item>
</style>
Now there in your AndroidManifest.xml tag in the application tag you check if it has the theme defined:
<application
android:theme="@style/AppTheme" >
</application>
You can not change a default font size , however you can set a theme and where you can change the font size. To learn more, you can read about Styles and Themes in the Android developer reference documentation.
Example setting theme:
<style name="MyTheme" parent="AppBaseTheme">
<item name="android:textSize">18sp</item>
</style>
In this way, you will set a default size for all TextView
within your application. To define a specific size individually, you can do this:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Trump eh o novo presidente dos EUA"
android:textSize="40sp"/>
Always try to use SP
because it is sized independently of the normal font size of the device.
Details