Discussion Forums  >  Images, Documents, File Locations

Replies: 7    Views: 214

Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
04/24/14 01:20 AM (10 years ago)

Retina images 2x and Html text

I am building an app mainly with pluggins HTML text where I put my code. I have quite a lot of images and have created two different versions of these, image.jpg and [email protected]. I have placed these in BT_images. When I run the app via Xcode It will not change to retina image ([email protected]) when simulating retina display in the simulator. That means the images is blurred or to small on a retina display. I have also run the app with only retinal images in BT_images and then everything is working fine, even on devices with no retinadisplay (on the simulator). But I think this is not the appropriate solution (According to Appel guidelines you should provide both types of images). Did I miss typing in any code in the HTML text that allows retina images ([email protected]) change when I run the app on a retina display? When you work out on the web so is the case then ... But what I understand, the Xcode (= actual app) detect when there is a retina display or not and then pick up the right image ...?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/24/14 02:07 AM (10 years ago)
I used to use double size @2x images for apple, but I've stopped doing so, I now just use the higher quality images for everything. I used it for iPad support and I recall it did work in my app. I believe the apple guidance was more appropriate for older devices (e.g. like an iPhone 3), maybe it helped as the older processors were not so powerful. Now, I think the benefit of having one image file outweighs the apple guidance and in my opinion, buzztouch manages the scaling pretty well. If you go with one set of images, I can't see a downside. Alan
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
like
04/24/14 02:26 AM (10 years ago)
Hi Alan Thanks for the reply It sounds like it should work with only pictures in reitna quality. Thats great! I will use it if I do not manage to get it work with the solution image.jpg and [email protected] If I still want to try to create an app with the both image qualities, what's missing in my attempt?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/24/14 02:39 AM (10 years ago)
Don't know what is missing, but all I did was to put the images I was using side by side in the folder they were called from, e.g. image01.jpg sat alongside [email protected]. To be sure it was working, I even used different images to prove it! Try it with png?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/24/14 05:17 AM (10 years ago)
I think the thing is, using 'HTML' to display an image has nothing to do with 'iOS'. As far as iOS knows, 'He said display a web page, so we did'. And then it's up to the HTML code, which has no clue what @2x means. If your 'iOS code' references an image, it will reference a std image for non retina devices, and will use the @2x in 'applicable' situations. In this case, I'd follow AlanMac's suggestion, and use a higher quality image for all of your HTML documents, just to be on the safe side. Cheers! -- Smug
 
Shorewalk
Lost but trying
Profile
Posts: 54
Reg: Nov 06, 2012
location unknow...
10,040
like
04/24/14 06:09 AM (10 years ago)
OK, then I only use images for retina and hope that it will work even for older iPhones. Thanks again
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/24/14 08:06 AM (10 years ago)
Hi shore walk, Yep, just delete your smaller images entirely, and no need to have the @2x in the names anymore on the high quality images. Apple changed the way xcode works, and now it sees the high quality images automatically, assumes they are @2x (based on the size it sees), and then automatically scales them down to the smaller size when ran on non-retina devices with 3.5" screens. :)
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/24/14 10:40 AM (10 years ago)
Btw, my test devices are an iPhone 3GS and and iPhone 5, my approach works for me on both.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.