gpt4 book ai didi

flutter - 如何使文本或富文本在 flutter 中可滚动?

转载 作者:IT王子 更新时间:2023-10-29 06:51:58 24 4
gpt4 key购买 nike

好像text/richtext只支持一页,如果内容超出屏幕,就不能上下滚动了。有没有简单的方法来启用它?或者我必须使用滚动小部件?

最佳答案

Flutter 提供了大量的 Scrolling Widgets documentation

示例:SingleChildScrollView

enter image description here

class mytext extends StatelessWidget {
var randomtext="....";
@override
Widget build(BuildContext context) {
return new Container(child: new Scaffold(
appBar: new AppBar(),
body: new SingleChildScrollView(child:
new Text(randomtext,style: new TextStyle(fontSize: 30.0),),),
),);
}
}

关于flutter - 如何使文本或富文本在 flutter 中可滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49617934/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com