小编Adz*_*bar的帖子

react-native选择器使用androidstyles.xml更改字体系列未更改

我想要在 react-native 选择器上使用 style font-size 和 font-family 。我已经在原生 android 上设置了自定义样式。但是在我再次构建 apk 之后没有改变它仍然是相同的字体。

我在 style.xml 上的代码

<resources>
 <!-- Base application theme. -->
 <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
     <!-- Customize your theme here. -->
     <item name="android:spinnerItemStyle">@style/SpinnerItem</item>
 </style>
 <style name="SpinnerItem" parent="Theme.AppCompat.Light.NoActionBar">>
   <item name="android:fontFamily">CenturyGothicBold</item>
   <item name="android:textSize">16dp</item>
 </style>
</resources>
Run Code Online (Sandbox Code Playgroud)

已设置使用 react-native 链接在资产上添加新字体

我的结果

android react-native react-native-android

5
推荐指数
1
解决办法
672
查看次数