首页 > Web开发 > 详细

Flutter 宽高比(比率)控件 AspectRatio

时间:2019-05-21 20:33:50      阅读:335      评论:0      收藏:0      [点我收藏+]

const AspectRatio({
Key key,
@required this.aspectRatio,
Widget child,
})

void
main() {  runApp(    new MaterialApp(      title: ‘Demo‘,      home: new Scaffold(        appBar: new AppBar(          title: new Text(‘Demo‘),       ),        body: new Center(          child: new Container(            child: new AspectRatio(              aspectRatio:3/2, //横纵比 长宽比 3:2              child: new Image(image: new AssetImage(‘images/demo.jpg‘)),//项目资源文件           ),         ),       ),     ),   ), ); }

 

Flutter 宽高比(比率)控件 AspectRatio

原文:https://www.cnblogs.com/crane13/p/10902074.html

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