UIImage imageNamed not setting image in iphone6 [closed] - ios

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
Hi am working on ios project using xcode 6.0.1,ios 8.While I am running my app in iphone6 simulator it is not showing my image.I have set my image using the following code,[UIImage imageNamed:#"/Resources/btnbg.png"].What is the reason for this.it is perfectly working in my iphone4s.

Please check your retina size image i.e. btnbg#2x.png.As may be the retina size image is not being loaded properly.As iphone 6 loads retina size images that is in the form of ImageName#2x.png.

No need to write full path.
user only image name as below:
[UIImage imageNamed:#"btnbg.png"]
It'll take full path automatically.
And also check #2x image of same image.

Related

image not showing in launchscreen [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I have an old project and convert into swift 3. It have simple launch screen storyboard . Launch screen storyboard have an image as logo of company, This image not showing into device but i replace that image with another image , replaced image showing perfect. Launch screen behave strange.
Just delete launch screen storyboard and make a new launch screen storyboard then new image view on it .Make sure your image size 1x,2x,3x available.

iPhone 6 Autolayout issue [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
A year ago i created an iphone app with xcode 6, i addded the autolayout, everything works fine on iphone 5 and iphone 6, but earlier i created a new app which is a duplicate of the older app, i added also autolayout but nothing works normally on iphone 6, the size of images, buttons are small however i added the #1X and the #2x size. i used the sames ressources as the older app.
The difference between older app and the newest one is that before i use ModalViewControllers but now i use ContainerViewController and switching between views.
I did not understand from where it comes the problem.
This is a screen shot of older app on iphone 6
And This is a screen shot of the newest app on iphone 6
What can be the problem?
Thank you for help.
It is unclear from your question what your problem actually is (both screenshots look fine), but I guess your issue is that on the second one the elements are somewhat smaller in proportion to the screen, is that it?
If so, that's because the first one is running in iPhone 5 (4" screen) emulation mode, just scaled up to take more space on the larger screen, while the second one runs in native iPhone 6 mode. The views are actually the same size as on an iPhone 5, they just take less space in proportion to the size of the screen (that's the goal of a larger screen).
Check the SDK version the app is build against, as well as the presence of a Launch Screen XIB, I believe those are the triggers for switching to the native mode.
If you want (some) UI elements to be larger on larger screens, you can use height or width constraints with multipliers, but fonts are trickier, you'll need to handle that in code.

I want to change iPad resources to iPhone [duplicate]

This question already has answers here:
How to resize the image programmatically in objective-c in iphone
(10 answers)
Closed 9 years ago.
I created an app of target to iPad and now i want to make an universal app and the time for adjusting my iPad app to iPhone would decrease significantly.
I have set of images (more than 200 images) on iPad dimensions and i want to convert that to iPhone dimension with clarity using objective c (Programmically). I won't need to change iPhone dimension manually, add to Xcode. Because size will increase. if there is an answer for this question.
Thanks.
Kindly look at this other post in stackOverflow
If you want a pixel wise re-sampling refer here and here
hope that helps.

Retina 4inch simulator is misplacing everything in my app [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
After upgrading to xcode 5 then when I test my app on retina 4 inch screen, it misplaces some of the objects I've put in my app. I tried everything and only have one solution that may work but would be very annoying to do. It is the screen detection method. I really don't want to go through the hassle changing a lot of my code just so that it can be compatible with a 4inch retina, because I would have to rewrite a lot of code just for a 4inch retina display... Is there a way to make it so that everything could be stretched to fit to screen?
Two possible Solutions:
For all of your nib (.xib) files or Views if using Storyboard, select View and set Size parameter value as "Retina 3.5-inch Full Screen". But using this one will fix your app screen height to 3.5inch.
In Inspector-tab, for every view items like labels, buttons, etc, set "Autosizing" parameters to stretch, reposition, fix or flexible positions and sizes of items according to change in screen height.

StoryBoards supporting #2x and -568h file images [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
In my program I use "StoryBoard" and when I first start the application window should appear with instructions.
So, is it possible to add an image in the UIImageView, in StoryBoard, and run the application on iphone 3gs this image bends
In the application resources are files Introdusing#2x.png, Introdusing-568h#2x.png and Introdusing.png, but on all devices use only Introdusing-568h#2x.png. How to fix it?
Please help....
If you ask for an image image, iOS will check for image#2x.png and image.png, using the appropriate one for the device's resolution. iOS will not check for -568h images, so by providing an image Introdusing-568h#2x.png, your program will check for Introdusing-568h#2x.png and Introdusing-568h.png, and, not finding the latter, it will use Introdusing-568h#2x.png in all cases. You have two options: tell IB to use Introdusing.png or Introdusing#2x.png and let iOS pick from just those two, or you can determine programmatically whether the device is a retina-4 and use the appropriate image.
Also, PLEASE correct the name; it should be "introducing," not "introdusing," and in context it should probably be a noun, "introduction".
In IB you need to make sure that the image linked to your image view is set to the lowest quality .png file. So in your case make sure it's set to Introdusing.png and not Introdusing-568h#2x.png. It will determine the proper image to use at run time.
If I understand you correctly, basically you have 3 files: Introdusing#2x.png, Introdusing-568h#2x.png and Introdusing.png.
If you want ALL devices to use Introdusing-568h#2x.png, then set the UIImage to Introdusing-568h#2x.png file and delete the other two files. Keep in mind this will cause some displaying issues in old iPhone 3G/GS and iPhone 4 screens. You may see distortion as the older iPhones scales the image to fit that screen so test your app for each of the phones and see if that's ok with you.
If you want to use the correct image for the 3GS, iPhone 4/4S and iPhone 5 screens, then set the image to Introdusing.png and UIImageView will figure out which image size is the best one for the different phone models.

Resources