繁体   English   中英

如何在颤振中添加图像

[英]how can I add a image in flutter

我在添加图像时遇到问题...我的代码是

 child: Column(
             
                children: [
                Image.asset('assets/logo.jpg'),
                Text('This is SplashScreen')
]
),

但还没有工作..我也启用了 pubspec.yamel assets commnet 但没有改变任何东西

在 pubspec 文件中的资产标签后添加图像的路径,如下所示:

  assets:
    - assets/ilustration/b1.png

然后重建你的应用程序

确保主树中有一个 assets 文件夹,而不是嵌套在另一个文件夹中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM