简体   繁体   English

如何设置启动屏幕图标的大小?

[英]How to set size for launch screen icon?

I am trying to setup a launch screen that will flow seamlessly into a personal splash screen in flutter.我正在尝试设置一个启动屏幕,该屏幕将在颤动中无缝流入个人启动屏幕。

The goal is that I have the logo, centered on both Launch and Splash, that is lets say 10px from both left and right of a portrait only app.目标是我有徽标,以 Launch 和 Splash 为中心,也就是说,距仅肖像应用程序的左侧和右侧各 10 像素。

I don't understand what image size I would need to be able to set this up properly on Android.我不明白我需要多大的图像大小才能在 Android 上正确设置它。 I have drawable-**** folders with varied sizes but they don't fit correctly.我有不同大小的 drawable-**** 文件夹,但它们不适合。 Other than 'centering' the image in the Android xml I don't know how I would make it 'fit width' basically.除了在 Android xml 中“居中”图像之外,我不知道我基本上如何使它“适合宽度”。

On iOS my icons show up as centered in the LaunchScreen.storyboard but are super tiny (96x96).在 iOS 上,我的图标在 LaunchScreen.storyboard 中显示为居中,但非常小 (96x96)。 If I manually resize the image to fit the way I want(in Xcode view scene), when I run the app I get a warning saying that the view does not have unlatching constraints and it will be shown as the original small size.如果我手动调整图像大小以适合我想要的方式(在 Xcode 视图场景中),当我运行应用程序时,我会收到一条警告,说视图没有解锁约束,它将显示为原始的小尺寸。

launch screen icon use fit function启动屏幕图标使用适合功能

for example例如

return Scaffold(
  appBar: AppBar(
    // Here we take the value from the MyHomePage object that was created by
    // the App.build method, and use it to set our appbar title.
    title: Text(widget.title),
  ),
  body: Center(
    // Center is a layout widget. It takes a single child and positions it
    // in the middle of the parent.
    child: Image.asset('repo/intro.jpg' width: 100 , height: 100, fit: BoxFit.fill,),
  ),
  floatingActionButton: FloatingActionButton(
    onPressed: _incrementCounter,
    tooltip: 'Increment',
    child: Icon(Icons.add),
  ), // This trailing comma makes auto-formatting nicer for build methods.
);

https://api.flutter.dev/flutter/painting/BoxFit-class.html https://api.flutter.dev/flutter/painting/BoxFit-class.html

apple launch Storyboard use fit too苹果推出 Storyboard 也使用 fit

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

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