-
Notifications
You must be signed in to change notification settings - Fork 500
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
Fit titleIconView to page width #212
Comments
Have you tried using |
What happens if you drop your image in example project? |
Sorry. In my screenshot, the intro screen is the two blue guys. Here is what I have so far with KXIntroView (https://github.com/kolyvan/kxintro). I am seeking to approximate this experience using EAIntroView. |
Ok, now I see. |
Here is how you can do it now: EAIntroPage *page1 = [EAIntroPage page];
page1.title = @"Testing image";
page1.desc = sampleDescription1;
page1.bgImage = [UIImage imageNamed:@"bg1"];
UIImage *testImage = [UIImage imageNamed:@"image"];
UIImageView *testImageView = [[UIImageView alloc] initWithImage:testImage];
float imageRatio = testImage.size.width / testImage.size.height;
float widthToFit = self.view.bounds.size.width;
[testImageView setFrame:CGRectMake(0, 0, widthToFit, widthToFit / imageRatio)];
page1.titleIconView = testImageView; In EAIntroView we're preserving original image size 1:1. Code above will resize |
Very nice, thank you! In portrait orientation this will work. I'll need to figure it out when rotating or switching to other devices. |
I'll look into it on weekend and give you update. |
Added autolayout constraints to fit titleIconView inside page frame - a090a15 With your image it produces same screenshot as workaround above. Also works in landscape. To add padding between description and screen bottom and fit pageControl there - you can add empty newlines at the end of page description. Released in 2.11.0. |
Thank you, this works great now! |
I was expecting the image to take up the available space. This is the code we used:
This is what we got
Currently best practice is this implementation: https://github.com/kolyvan/kxintro
The text was updated successfully, but these errors were encountered: