flutter 真机iOS字体偏小
Flutter ios 字体偏小
·
造成原因:苹果手机用户把字体设置成小号字体
关键代码
MediaQuery.of(context).copyWith(textScaleFactor: 1.0, boldText: false)
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
brightness: Brightness.light,
primaryColorBrightness:Brightness.light,
textTheme: TextTheme(display1: TextStyle(fontSize: 30)),
fontFamily: "PingFang SC",
primaryColor: Color(0xfff9f9f9),
),
// home: LoginInfoController(),
home: SplashPage(),
//加上下面这段代码
builder: (BuildContext context, Widget child) {
return MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0, boldText: false),
child: child
);
},
);
更多推荐
已为社区贡献6条内容
所有评论(0)