【问题标题】:How to show animated gif file in Flutter IOS version?如何在 Flutter IOS 版本中显示动画 gif 文件?
【发布时间】:2022-01-15 02:53:10
【问题描述】:
@override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.only(right: 130, left: 130),
      color: Colors.white,
      child: const Image(
        image: AssetImage('assets/img/loader.gif'),
      ),
    );
  }

【问题讨论】:

标签: ios iphone flutter


【解决方案1】:

如果您需要将其设置为视图的墙纸,请使用这种方式

Container(
                        height: MediaQuery.of(context).size.height,
                        width: MediaQuery.of(context).size.width,
                        decoration: BoxDecoration(
                            image: DecorationImage(
                                fit: BoxFit.cover,
                                image: AssetImage("assets/images/gif.gif"))),
                      ),

【讨论】:

    猜你喜欢
    • 2020-05-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-26
    • 2019-01-04
    • 1970-01-01
    相关资源
    最近更新 更多