I have an app where the designer has given me assets or png's in two formats, non retin and retina,well formatted and named with #2 properly.
the retina images work fine, but the non retina images show a weird white background behind them. anyone ever experience this?
Here in those two images, they are both showing against a black uiview, when running retina the arrow fills with a black background, but for non retina devices its a white background.
I don't think it's the problem, but from your question it look like you forgot #2x in the name of your image.
For non-retina display the correct name is youImage.png and for retina youImage#2x.png
Check your youImage.png in photoshop (for example) and check if the background is not part of the image itself. It append to me more than one...
Edit:
Since you added the two picture in your post, I can confirm:
Your non-retina picture (the small on) got white background embedded. Ask your designer to remove it and use a transparent background.
Edit2:
Try with this picture as non-retina image. I removed the background for you (quick and durty just to test)
=====>
Edit3:
I edited your image and set a red background. Now you can clearly see that your non-retina image embed a background.
Related
I have built responsive website which works great on all devices except iOS.
On iOS devices, my background images get blurry.
Here is link to my website. http://www.idynxschool.com/vesco/
You can view it on iPhone and you will find blurry images. Is this something to do retina ready images?
Any solution will be really appreciated.
Thanks
In Safari on iOS, there is a known limitation when displaying large PNG and GIF images. The issue is triggered by the overall number of pixels in the image, so even if an image is narrow, you can experience blurriness if the image is tall enough.
This affects both the iPad and iPhone and affects all models of device. However, the exact image size that triggers the issue varies from iPhone to iPad and between models. For example, if you’re creating an image for iPhone 6 Plus that is 1080px wide, then the image can be up to ~4800px tall before blurriness would occur.
If you use JPG instead of PNG or GIF, then you may see less blurriness since the limit is increased for JPG images. For PNG or GIF images, however, the only way to work around this issue at current is to reduce the dimensions of the image until they’re below the limit that causes the issue.
Answer found: https://support.invisionapp.com/hc/en-us/articles/204660949-Why-are-my-images-in-iOS-blurry-
I've got an image with 1x , 2x and 3x types with resolutions 404*750 , 808*1500 and 1212*2250 respectively.
Here is my code:
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"bgr"]];
On my iPhone the background is not repeated and its good. but the iPad background is repeated 4 times.
Would you know why is this happening?
From Apple's reference
You can use pattern colors to set the fill or stroke color just as you
would a solid color. During drawing, the image in the pattern color is
tiled as necessary to cover the given area.
So in iphone device image is large enough to cover the area ... but in ipad it's not large enough to cover the area ... so it will repeat itself.
You can use image.xcassets for different image for iphone and iPad ...
see the screen shot
You can use different image for iPad with proper size to overcome this error
iOS will pick the image itself if you just follow the naming convention.
1x: my_image.png
2x: my_image#2x.png
3x: my_image#3x.png
1x iPad: my_image~ipad.png
2x iPad: my_image~ipad#2x.png
I know I should have two versions of my image, one standarad and one #2x but my app downloads a vast amount of content which i need to optimise. Im looking at using just retina images in my downloaded content and then seeing if there is an objective c way to take a graphic half it and make it none retina. using a retina image on my non retina ipad looks blurry.
For images. You have to download separate images with your desired dimensions. For example Facebook timeline has separate image for user icon (e.g. 25x25). and For ever post having photo, a thumbnail is generated say it has dimensions (310x160). And then when a user clicks the image to view. It opens the original Image. Whatever dimensions it has. So, In your case. you have to download two images. One for your non retina and one for retina. You can use Flicker API's for that.
Note: You can skip this and continue with retina display because Non retina devices are rarely being used now. So, every one has retina device and app will work perfect with your existing scenario.
I have 2 files called image.png and image#2x.png sizes: 320x568 and 640x1136.
If I use those files as background, does this solve the dead space on the iphone 5? Will the iphone 5 load the #2x picture? I understand that in an iphone with 3.5 and lower the background picture will get cut but I don't really care about it.
I have a project that is for both iPhone 5 and the four. For my background image, I made a uiview that was the size of the entire view. I then hooked this up to my background jpeg file. Under mode in the attributes inspector, I selected scale to fill. Since the uiview is held to all sides of the view, it works for both. It looks great in either size screen. The jpeg is pretty high res, but I didnt need to place any #2x. Hope this helps you out.
I am working on an iPhone app that has a tab bar. I made the tab bar icons using a vector graphics editor and exported them to PNG. The icons look fine, except when selected.
This doesn't happen on the retina display.
I use self.tabBarItem.image = [UIImage imageNamed:#"Symbol"]; to set the image.
Here is the actual PNG: http://i.imgur.com/dBTDe.png (though it happens with all the images).
What can I do about this? Why does this happen?
This appears to happen when the images don't have a margin. If you add a margin of 2px it will look fine:
You should have 2 copies of the image. One for normal or older devices, and one for retina display.
Your images should be named accordingly.
image1.png // older devices
image1#2x.png // for retina display. #2x is case sensitive as well
When you choose your image, be sure to choose the normal image. The OS will select the #2x image if it is capable of displaying it.