0

I am working on Xcode 5.1.1. My app works fine on all resolutions including latest iPhone6 and 6Plus.But my problem is the images are stretched in new resolutions.

For example,

I am having image with the pixels of 200*75 .How to set this image for iPhone 3.5 inch,4 inch,4.7 and 5.5 screens?

My designs are based on 3.5 inch screen.But my designer gave me the image(200*75) from iPhone6 plus screen design.How to fit the image for all resolutions?

Any help would be greatly appreciated.

Thanks.

Thangavel
  • 216
  • 2
  • 10
  • Why are you using an old version of xcode? Why not update? – Popeye Nov 25 '14 at 09:41
  • I have used several third party frameworks.So when i run on Xcode 6 it throws me an error.So i need to update the third party framework.Before that i need to make UI update to store.So i'm using older version. – Thangavel Nov 25 '14 at 10:28
  • Why whats the point? You might as well update to xcode 6 before you do anything. You should always do your development on the latest version. Also you'll probably find that xcode 6 has new features to help with your issue. – Popeye Nov 25 '14 at 10:32
  • Yes definitely.xcode 6 has new features.But i need to update the app with Xcode 5.1.1. Because i am optimizing my code with Xcode 6.Before that i need to update the UIChanges.So only working with 5.1.1.Thanks for your reply. – Thangavel Nov 25 '14 at 10:37
  • Why???? There absolutely seems no point you are just creating more work for yourself. You can't submit your app with builds using xcode 5.1.1, there are less features, you'll just have change your code again in case you are using deprecated methods which there are a few of. Seems absolutely redundant. – Popeye Nov 25 '14 at 10:39
  • iPhone 6/6 Plus development is not supported with Xcode 5.1.1. If you want your app to behave correctly for iPhone 6/6 Plus you have to update Xcode. There's no other possibility. – Thomas Deniau Nov 25 '14 at 11:33
  • Ok.I can use xcode6.But my problem is not related to Xcode versions.Consider an image 414*75,it automatically adjust the size to 320*49 for 3.5 inch screen based on auto layout.My problem is not that.The image which i had used (.png file) shrinked on small devices due to its original size.So can i need to use 3 images for 3 resolutions for 4 inch,4.7 and 5.5 screens? like retina images and non-retina? – Thangavel Nov 25 '14 at 11:38
  • Right not sure how many times we can say this. UPDATE YOUR XCODE. Whats the point in asking us for help if you are going to ignore the advice we are giving you? – Popeye Nov 25 '14 at 13:23

2 Answers2

0

try this

 self.imageView.contentMode=UIViewContentModeScaleToFill;
Sheshnath
  • 3,293
  • 1
  • 32
  • 60
  • Its ok for image views.But it is not possible to set all buttons,image views and other UIElements.So i am searching here for other solutions.But thanks for your suggestion.Is any other possible solutions like @2x,@3x? – Thangavel Nov 25 '14 at 10:30
  • what about autolayout ? – Sheshnath Nov 25 '14 at 11:10
  • Yes.It works.But my problem is consider an image 414*75,it automatically adjust the size to 320*49 for 3.5 inch screen based on auto layout.My problem is not that.The image which i had used (.png file) shrinked on small devices due to its original size.So can i need to use 3 images for 3 resolutions for 4 inch,4.7 and 5.5 screens? like retina images and non-retina? – Thangavel Nov 25 '14 at 11:34
  • as far as i know, you have to use three different image with conditional coding depending on screen size. – Sheshnath Nov 25 '14 at 11:45
0

We will need to apply auto layout + constraints in UI design so the app will support all devices.

Narendra Mistri
  • 113
  • 2
  • 8