Uniapp 中,在 page.json 文件中更改字体大小不生效可能是因为你没有在样式文件中定义具体的字体大小。

请在样式文件中添加以下代码:

body {
  font-size: 16px;
}

其中,16px 可以根据你的需要进行调整。这样,在 page.json 中设置字体大小就会生效了。例如:

{
  "navigationBarTitleText": "我的页面",
  "navigationBarTextStyle": "black",
  "navigationBarBackgroundColor": "#ffffff",
  "backgroundTextStyle": "light",
  "enablePullDownRefresh": false,
  "usingComponents": {},
  "style": {
    "navigationBarTitleText": '20px'
  }
}

这样,导航栏标题的字体大小就会变成 20px

Uniapp 页面标题字体大小设置不生效?可能是这里出了问题!

原文地址: https://www.cveoy.top/t/topic/mTUP 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录