美文网首页
flutter 系统组件学习一 Text组件

flutter 系统组件学习一 Text组件

作者: 崇德兴仁 | 来源:发表于2020-01-06 16:25 被阅读0次

    前言

    开发中最常用的组件就是text组件,对应ios里面的就是UILabel控件了

    使用方法

    Text(
                  'You have pushed the button this many ave pushed the button this manyave pushed the button this manyave pushed the button this manyave pushed the button this manytimes:',
                  textAlign: TextAlign.end,
                  textDirection: TextDirection.ltr,
                  maxLines:2,
                  softWrap: true,                  
                  overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
                  style: TextStyle(
                    // color: Colors.red,
                    // backgroundColor: Colors.blue,
                    fontSize: 30.0,
                    fontWeight: FontWeight.w900,
                    fontStyle: FontStyle.italic,
                    letterSpacing: 2, // 字母间距
                    wordSpacing: 4,   // 单词间距
                    height:2, // 行间距倍数
                    foreground: Paint()..color = Colors.blue,
                    decoration:TextDecoration.combine(
                      [TextDecoration.underline,
                      TextDecoration.overline,
                      TextDecoration.lineThrough]
                    ),
                    decorationColor:Colors.red,
                    decorationStyle: TextDecorationStyle.dotted,
                    decorationThickness:1.0, 
                  ),
                ),
    

    运行的效果如下:


    屏幕快照 2020-01-06 下午4.18.46.png

    相关文章

      网友评论

          本文标题:flutter 系统组件学习一 Text组件

          本文链接:https://www.haomeiwen.com/subject/vcukactx.html