首页 > 其他 > 详细

Baseline

时间:2020-03-13 18:00:58      阅读:68      评论:0      收藏:0      [点我收藏+]

指定子Widget的基线,包含两个主要属性:

  • baseline

    指定子Widget内容的基线位置,从外框也即是父控件的顶部位置开始定位基线位置。

  • baselineType

    基线的类型,包括TextBaseline.ideographic和TextBaseline.alphabetic。

  • TextBaseline.alphabetic

    对齐字母字符的水平线。

  • TextBaseline.ideographic

    对齐表意字符的水平线。

 Widget getBaseline() {
    return Column(
      children: <Widget>[
        Container(
          width: 200,
          height: 100,
          margin: EdgeInsets.all(100),
          color: Colors.blueAccent,
          child: Baseline(
            baseline: 0,
            baselineType: TextBaseline.alphabetic,
            child: Text(
              ‘Baseline type alphabetic‘,
              style: TextStyle(fontSize: 20),
            ),
          ),
        ),
        Container(
          width: 200,
          height: 100,
          margin: EdgeInsets.all(100),
          color: Colors.blueAccent,
          child: Baseline(
            baseline: 0,
            baselineType: TextBaseline.ideographic,
            child: Text(
              ‘Baseline type ideographic‘,
              style: TextStyle(fontSize: 20),
            ),
          ),
        )
      ],
    );
  }

 

Baseline

原文:https://www.cnblogs.com/timba1322/p/12487563.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!