如何使文本或RTF在Flutter中滚动? [英] how to make text or richtext scrollable in flutter?

查看:79
本文介绍了如何使文本或RTF在Flutter中滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎文本/富文本仅支持一页,如果内容超出屏幕,则无法向上/向下滚动.有一个简单的方法可以启用它吗? 还是我必须使用滚动小部件?

It seems text/richtext only support one page, if the content exceed the screen, you can't scroll up/down. Is there an easy way to enable it? Or I have to use the Scrolling Widgets?

推荐答案

Flutter提供了许多滚动小部件文档

Flutter provide a lot of Scrolling Widgets documentation

示例: SingleChildScrollView

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),),),
),);
 }
}

这篇关于如何使文本或RTF在Flutter中滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆