在styles.xml中设置默认字体大小

Bob*_*421 0 android xamarin

我正在做一个android项目。

我有一个选项卡式页面,页面标题很大。我想要做的是通过更改styles.xml中的值来减小字体大小

你知道这是否可能吗?

该项目是用Xamarin编写的,所以我要避免编写一些特定的代码,例如渲染器。

非常感谢

小智 6

这可能 styles.xml如下:

 <style name="FontTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:textSize">20sp</item>
        <item name="android:textColor">@color/black</item>
 </style>
Run Code Online (Sandbox Code Playgroud)

使用代码:

<TextView   
    style="@style/FontTheme"  
    android:layout_marginTop="100dp"  
    android:text="test1"/>
Run Code Online (Sandbox Code Playgroud)