Skip to content
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

Images have margin when added to Layout #1425

Closed
manijak opened this issue Jan 23, 2016 · 6 comments · Fixed by #2306
Closed

Images have margin when added to Layout #1425

manijak opened this issue Jan 23, 2016 · 6 comments · Fixed by #2306
Assignees
Milestone

Comments

@manijak
Copy link

manijak commented Jan 23, 2016

When I add Image(s) to any Layout (tested on Stack and Grid), the images is added with margins on the left and right side (around 5 px on each side). Isn't it supposed to fill the width of the container and keep aspect? I tried also with stretch="AspectFill" same result.

But as soon as I set a specific height to the image, the margins are gone.

@vchimev
Copy link
Contributor

vchimev commented Feb 1, 2016

@manijak, is this on iOS, Android or both? Could you please elaborate a little bit more on how to reproduce this and also make sure there is no unexpected css applied?

Here is my page:

<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded">
  <StackLayout>
    <Image src="~/red.png" />
  </StackLayout>
</Page>

screen shot 2016-02-01 at 4 31 16 pm

@manijak
Copy link
Author

manijak commented Feb 1, 2016

It's true, it does not happen everywhere. I tried adding some other images to the same view & container, and they fit as they should. I think it's a resize/aspect issue with some images.

The difference between images were the sizes. The images I have problems with are "banners" with a specific size of around: 994x172.

So there are no margins to be accurate, but there is some space on the left & right, so that the image does not fill the width.

apptest_imagew

@vchimev
Copy link
Contributor

vchimev commented Feb 2, 2016

@manijak, I tried the following specific image sizes: 1000x200, 998x199. 996x198, 994x197, 992x196 and with some of them I reproduced the issue. It is both on Android and iOS.

@hamorphis
Copy link
Contributor

Sample app: https://github.com/hamorphis/issue-1425

@hamorphis
Copy link
Contributor

hamorphis commented Jun 13, 2016

Android screenshot:
android

@lock
Copy link

lock bot commented Aug 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants