1:AspectRatio组件,可以控制子元素在父亲元素中的宽高比,让子元素布局和显示更加完美:
AspectRatio(aspectRatio: 1/2,child:Container()),child属性对应的container组件相对于在它的父组件中显示宽高比例为 1:2
2:Card组件,类似于卡片效果,周边有阴影的那种效果,配合listview中的listile使用做列表效果,用法:
Card()
属性如下:
this.color,
this.shadowColor,
this.elevation,
this.shape,
this.borderOnForeground = true,
this.margin,
this.clipBehavior,
this.child,
this.semanticContainer = true,
本文介绍了Flutter中用于控制子元素宽高比的AspectRatio组件及其用法,并详细讲解了Card组件的各种属性设置方法,帮助开发者更好地实现卡片式布局效果。
1265

被折叠的 条评论
为什么被折叠?



