美文网首页flutter
Flutter之SizedBox组件

Flutter之SizedBox组件

作者: 习惯了_就好 | 来源:发表于2019-01-22 16:40 被阅读9次
/**
 * 能强制子控件具有特定宽度、高度或两者都有,使子控件设置的宽高失效
 * const SizedBox({
 * Key key,
 * this.width,
 * this.height,
 * Widget child
 * })
 * */
body:SizedBox(
            width: 100.0,
            height: 100.0,
            child:  Container(
              width: 200.0,
              height: 200.0,
              color: Color(0xffff0000),
            ),
          )

相关文章

网友评论

    本文标题:Flutter之SizedBox组件

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