-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image size too big: add position and size settings #11
Comments
Currently there is no way to change the image position or size (fill, cover, contain) using the package. There is a pull request (#8) implementing As a workaround until that happens, you can manually modify
From Android docs:
On iOS, you can modify manually by using Xcode to position the image. I do not know yet how to change position by editing the code. |
In xcode, you can just open the launchimage storyboard and manually change the size of the image and just reset the constraints for the new positioning.
… On Aug 30, 2019, at 3:06 PM, Henrique Arthur ***@***.***> wrote:
Currently there is no way to change the image position or size (fill, cover, contain) using the package.
There is a pull request (#8 <#8>) implementing fill gravity on Android (so the image can fill 100% of the screen) merged into dev branch. I am trying to find a way to implement the same behaviour on iOS and I'll add more options like positioning the image (like top center). Once that's done it will be merged into master and a new version will be released, probably next week.
As a workaround until that happens, you can manually modify android/app/src/main/res/drawable/launch_background.xml and change android:gravity attribute on splash image bitmap to fill or clip_horizontal|clip_vertical:
<item>
<bitmap android:gravity="fill" ***@***.***/splash" />
</item>
From Android docs <https://developer.android.com/reference/android/graphics/drawable/BitmapDrawable.html#attr_android:gravity>:
fill: Grow the horizontal and vertical size of the object if needed so it completely fills its container.
clip_horizontal: Additional option that can be set to have the left and/or right edges of the child clipped to its container's bounds. The clip will be based on the horizontal gravity: a left gravity will clip the right edge, a right gravity will clip the left edge, and neither will clip both edges.
clip_vertical: Additional option that can be set to have the top and/or bottom edges of the child clipped to its container's bounds. The clip will be based on the vertical gravity: a top gravity will clip the bottom edge, a bottom gravity will clip the top edge, and neither will clip both edges.
On iOS, you can modify manually by using Xcode to position the image. I do not know yet how to change position by editing the code.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#11>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AF7MOFGJ553LWR24M2XZQTLQHGKW3ANCNFSM4ISQZYEA>.
|
On v0.1.8+1 you can use flutter_native_splash:
fill: true Positioning the image is not yet possible which is why I'm leaving this open, I will look into it soon. |
I look forward to the positioning, thanks for the update. I’ll also be able to use a screen shot of the opening screen as my image to use in this plugin.
… On Sep 16, 2019, at 6:13 PM, Henrique Arthur ***@***.***> wrote:
On v0.1.8+1 you can use fill property to make your image use all available width and height of the screen.
flutter_native_splash:
fill: true
Positioning the image is not yet possible which is why I'm leaving this open, I will look into it soon.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#11>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AF7MOFBVUWENUKJMFEQBVBLQKAVLNANCNFSM4ISQZYEA>.
|
so instead of |
I was thinking something like |
Commit 9a8b7ce allows the configuration of every Android gravity and iOS ContentMode option. |
Thank you for making this plugin, It fills a void quite nicely! However, using the plugin, my launch image far exceeds the width (and height is huge too) of my devices. Is there a feature I missed to contain the image or pre-size the image so that it's 100% within the boundaries of the width (with some padding). Also, it would be great if we could specify image top center, or center center. For my use anyway.
The text was updated successfully, but these errors were encountered: