簡體   English   中英

如何設置啟動屏幕圖標的大小?

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

我正在嘗試設置一個啟動屏幕,該屏幕將在顫動中無縫流入個人啟動屏幕。

目標是我有徽標,以 Launch 和 Splash 為中心,也就是說,距僅肖像應用程序的左側和右側各 10 像素。

我不明白我需要多大的圖像大小才能在 Android 上正確設置它。 我有不同大小的 drawable-**** 文件夾,但它們不適合。 除了在 Android xml 中“居中”圖像之外,我不知道我基本上如何使它“適合寬度”。

在 iOS 上,我的圖標在 LaunchScreen.storyboard 中顯示為居中,但非常小 (96x96)。 如果我手動調整圖像大小以適合我想要的方式(在 Xcode 視圖場景中),當我運行應用程序時,我會收到一條警告,說視圖沒有解鎖約束,它將顯示為原始的小尺寸。

啟動屏幕圖標使用適合功能

例如

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

蘋果推出 Storyboard 也使用 fit

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM