zoukankan      html  css  js  c++  java
  • 层叠布局Stack、Positioned

    Stack:绝对定位,

    对齐没有定位的或部分定位的子widget,部分定位指没有在某一个轴上定位,left、right为横轴,top、bottom为纵轴,只要包含某个轴上的一个定位属性就算在该轴上定位
    alignment:AlignmentDirectional.topStart
                   topEnd
                   topCenter
                   centerStart
                   center
                   centerEnd
                   bottomStart
                   bottomCenter
                   bottomEnd
     textDirection:TextDirection.ltr||rtl;
    fit:此参数用于决定没有定位的子widget如何去适应Stack的大小。StackFit.loose表示使用子widget的大小,StackFit.expand表示扩伸到Stack的大小。
    overflow:此属性决定如何显示超出Stack显示空间的子widget,值为Overflow.clip时,超出部分会被剪裁(隐藏),值为Overflow.visible 时则不会。
    
    

    Positioned

    Positioned(
      left:18.0
      right:
      top:
      bottom
      
      height:
      child:
    )
    Stack(
      alignment:Alignment.center ,
      fit: StackFit.expand,
      children:<Widget>[
        Positioned(
          left: 18.0,
          child: Text("I am Jack"),
        ),
        Container(child: Text("Hello world",style: TextStyle(color: Colors.white)),
          color: Colors.red,
        ),
        Positioned(
          top: 18.0,
          child: Text("Your friend"),
        )
      ]
    )
  • 相关阅读:
    ASP.NET MVC IIS7 403.14-Forbidden
    SQL Server 查询锁表和接锁表
    一款不错的golang配置文件库
    某奇艺滑块
    爬虫系列
    Docker部署Python爬虫项目
    Cmder
    Selenium处理alert/confirm/prompt提示框
    Django2.0使用
    排序
  • 原文地址:https://www.cnblogs.com/shui1993/p/11166902.html
Copyright © 2011-2022 走看看