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

The image is not centered #246

Closed
meme17sk opened this issue Feb 14, 2021 · 11 comments
Closed

The image is not centered #246

meme17sk opened this issue Feb 14, 2021 · 11 comments
Labels

Comments

@meme17sk
Copy link

I’m using Agrume to display an image on my swift application.
But the image is not centered. I have to click in order to bring it to the center.
It is located to the left and when I click it goes to the center.
I’m displaying a single image.
Could you please help me?
Thank you

@meme17sk
Copy link
Author

@JanGorman please help me to solve this issue. Thank you

@JanGorman
Copy link
Owner

Can you shed some light on how you're using the library, what kind of image is showing, basically anything

As you may have seen the library ships with a sample project and when I run that locally it works fine: https://github.com/JanGorman/Agrume/blob/master/Example/Agrume%20Example/SingleImageViewController.swift

@meme17sk
Copy link
Author

meme17sk commented Feb 15, 2021

@JanGorman

A button is connected to a function that will be called once the button is pressed. The function body contains:

@IBAction func openImage(_ sender: Any) {
let argume = Agrume(image: UIImage(named: "my_image")!, background: .blurred(.regular))
agrume.show(from: self)
}

The image is shown but it is located on the left, and when i click or drag it, then it will be located correctly on the center.

The image is .png image

@JanGorman
Copy link
Owner

Thanks for the additional detail. That looks like it should work. Could you share:

  • iOS version
  • iPhone or iPad
  • Device in portrait or landscape mode
  • The pixel dimensions of the image

I tried a number of combinations (portrait/landscape/square, iPhone/iPad) and they all worked fine. Could you also try to checkout the Agrume project and add the image to the Example project yourself to see if it behaves the same as it does in your project, only to eliminate that option. Thanks

@meme17sk
Copy link
Author

Thanks for the additional detail. That looks like it should work. Could you share:

  • iOS version
  • iPhone or iPad
  • Device in portrait or landscape mode
  • The pixel dimensions of the image

I tried a number of combinations (portrait/landscape/square, iPhone/iPad) and they all worked fine. Could you also try to checkout the Agrume project and add the image to the Example project yourself to see if it behaves the same as it does in your project, only to eliminate that option. Thanks

I'm running my app on: iPhone 11 pro max simulator on Xcode
in portrait position
image Dimensions : 4167 × 4202

@JanGorman
Copy link
Owner

Thanks. So I gave it another try with an image the same size you're using and it looks fine to me. I would suggest to try to isolate the button into a fresh UIViewController with only the button and work backwards from there

output

@meme17sk
Copy link
Author

@JanGorman thank you so much
I really appreciate your help

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@meme17sk
Copy link
Author

meme17sk commented Apr 7, 2021

I found out the problem

The image was not centered when the app language is not English
When I set the application language to Arabic, the image is not centered

But when the app language is English,the image is perfectly showing

Do you have any idea how to fix this issue?

@meme17sk
Copy link
Author

meme17sk commented Apr 7, 2021

@JanGorman please check my last comment

Thanks

@JanGorman
Copy link
Owner

Thanks @meme17sk – great detective work! I'll take a look with that extra information

@JanGorman JanGorman reopened this Apr 7, 2021
@JanGorman JanGorman reopened this Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants