zoukankan      html  css  js  c++  java
  • flutter 初探1--本机图片展示

    1、加载本地图片:

    Transform.translate(
                offset: Offset(-11.0, -73.0),
                child:
                    // Adobe XD layer: '注册APP背景' (shape)
                    Container(
                   413.0,
                  height: 733.0,
                  decoration: BoxDecoration(
                    image: DecorationImage(
                      image: const AssetImage('assets/images/background.png'),
                      fit: BoxFit.fill,
                    ),
                  ),
                ),
              ),
    

      

    1. 将图片放到assets 文件夹,分三份放好;
      1.   
    2. 在pubspec.yaml中配置
      1. flutter:
        
          # The following line ensures that the Material Icons font is
          # included with your application, so that you can use the icons in
          # the material Icons class.
          uses-material-design: true
          assets:
            - assets/images/background.png
            - assets/images/2.0x/background.png
            - assets/images/3.0x/background.png
        
    www.beicaiduo.com
  • 相关阅读:
    第八章 路由器交换机及其操作系统的介绍
    k-Tree DP计数
    Drop Voicing 最长升序
    高精度
    1196D2
    C
    POJ 3974 马拉车
    2020.8.1第二十六天
    2020.7.31第二十五天
    每日日报
  • 原文地址:https://www.cnblogs.com/hoge66/p/13111516.html
Copyright © 2011-2022 走看看