jonbhanson / flutter_native_splash

Automatically generates native code for adding splash screens in Android and iOS. Customize with specific platform, background color and splash image.
https://pub.dev/packages/flutter_native_splash
MIT License
1.36k stars 215 forks source link

iOS Launch Backgrounds not working in certain content_modes #726

Open Taormina opened 2 months ago

Taormina commented 2 months ago

Attention: If you open a bug report without sufficient details, it will be closed. Is your question related to Android 12? Please check the notes on Android 12 first (https://pub.dev/packages/flutter_native_splash#android-12-support).

Describe the bug

On iOS, the scaleToFill option is not working as expected. I was able to manually get it to work, but I wanted to report my findings to further improve the library.

Configuration

flutter_native_splash:
  background_image: assets/images/town.png
  ios_content_mode: scaleAspectFill

Device (please complete the following information):

To Reproduce 1) Run the library to produce ios_content_mode: center results. 2) Observe that everything is fine. 3) Rerun the library with ios_content_mode: scaleAspectFill. 4) Observe a black splash screen. This is even visible in XCode's LaunchScreen storyboard.

Screenshots If applicable, add screenshots to help explain your problem. If in doubt, attach a screenshot. Excepted Result: Screenshot 2024-09-01 at 2 27 01 PM

Actual Result: Screenshot 2024-09-01 at 2 28 30 PM

Additional context The left is the code I manually changed to get it to work. I think that the view, image AND background is being given scaleToFill, but I think only the LaunchBackground needs to be given the contentMode and we want to leave the overall view and foreground image alone for now. Screenshot 2024-09-01 at 2 28 45 PM