1

In order to make a Slide Show, I installed the KASlideShow pod, which is perfect. On the iphone 5S, my Slideshow took all the width (What I wanted), but, when it comes to test the app on the iPhone 6, it takes only 3/4 of the screen.

I tried to scale the UIImage using this method :

CGRect rect = CGRectMake(0,0, width, height);
UIGraphicsBeginImageContext( rect.size );
[originialImage drawInRect:rect];
UIImage *finalImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

NSData *imageData = UIImagePNGRepresentation(finalImage);
UIImage *img=[UIImage imageWithData:imageData];

But it only scales to 3/4, even if I put enormous values. It's as if there was a limit. I tried to use UIViewContentMode.ScaleAspectFill attribute, but it doesn't do anything. I do not have more ideas to test :/

Thanks for your help.

Greg Ballot
  • 203
  • 2
  • 8
  • Have you change `UIImageView` accordingly? – Kampai Dec 11 '14 at 10:10
  • Well, I do not work with UIImageView objects. I use a method of KASlideShow (addImage) that takes a UIImage as parameter – Greg Ballot Dec 11 '14 at 10:36
  • Internally `KASlideShow` handles `UIImageView` because without imageView you can not use image directly. Check this library. – Kampai Dec 11 '14 at 10:37
  • I know we need `UIImageView` to display the data of a UIImage, the problem is not in the display, I know how to scale images, (the code above do it) but, I cannot scale more than something like 300px – Greg Ballot Dec 11 '14 at 10:56
  • May be this will help you - http://stackoverflow.com/questions/6703502/how-to-resize-an-uiimage-while-maintaining-its-aspect-ratio – Kampai Dec 11 '14 at 10:59
  • Well, after doing lots of tests, I found what is the real problem : The SlideShow's images doesn't respect constraints. If you design it for a 5S, it will work on the 5S but not on the 6. I tried to design for the iPad using constraints (that work for other uI elements of the page), it doesn't work on the iPhone 6 and below (Image cropped) – Greg Ballot Dec 11 '14 at 11:23
  • 1
    You can contact to the `KASlideShow` library developer or if it is a git repo than put an issue in Git. – Kampai Dec 11 '14 at 11:26
  • Yes, I think that's what I'm going to do ! Thanks for your attention :) – Greg Ballot Dec 11 '14 at 12:15

0 Answers0