美文网首页Flutter
Widget-Container

Widget-Container

作者: 冰吻心玉 | 来源:发表于2019-05-24 16:04 被阅读0次

    Container  (容器控件)

    Alignment 

            Container内child的对齐方式,也就是容器子内容的对齐方式

            bottomCenter:下部居中对齐。

            botomLeft: 下部左对齐。

            bottomRight:下部右对齐。

            center:纵横双向居中对齐。

            centerLeft:纵向居中横向居左对齐。

            centerRight:纵向居中横向居右对齐。

            topLeft:顶部左侧对齐。

            topCenter:顶部居中对齐。

            topRight: 顶部居左对齐。

    padding

            padding:const EdgeInsets.all(10.0)

            EdgeInsets.fromLTRB(value1,value2,value3,value4) 可以满足我们的需求,LTRB分别代表左、上、右、下

    margin 

            使用方式类似Padding

    decoration

    container 的修饰器,主要的功能是设置背景和边框

    border:Border.all(width:15.0,color:Colors.red)    //宽度为15,红色的边框

    borderRadius:BorderRadius.all(Radius.circular(15)))   //圆角15

    例:

    相关文章

      网友评论

        本文标题:Widget-Container

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