相关疑难解决方法(0)

Flutter中的fontSize和textScaleFactor有什么区别?

的默认fontSize值为14.0。因此,textScaleFactor: 2.0似乎与fontSize: 28.0我的代码示例相同:

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Title')),
        body: Row(
          children: <Widget>[
            new Text("Jane", textScaleFactor: 2.0),
            new Text(" Doe", style: new TextStyle(fontSize: 28.0)),
          ],
        )
      )
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

优缺点都有什么?在特定情况下何时使用一种或另一种有什么建议吗?

flutter

3
推荐指数
2
解决办法
1992
查看次数

标签 统计

flutter ×1