且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

安卓:我如何设置一个布局TEXTSIZE?

更新时间:2023-11-19 14:36:28

要为所有的TextView S上的全球性的造型,将的android: textViewStyle 属性,自定义主题和应用主题,应用程序或个人活动。

To set the global styling for all TextViews, set the android:textViewStyle attribute in a custom theme and apply the theme to your application or individual activities.

伪code:

<style name="MyTheme" parent="android:Theme">
  <item name="android:textViewStyle">@style/MyTextView</item>
</style>

<style name="MyTextView" parent="android:Widget.TextView">
  <item name="android:textSize">14sp</item>
</style>

...

<activity android:theme="@style/MyTheme">
  ...