retina-display

Get device image scale (e.g. @1x, @2x and @3x)

与世无争的帅哥 提交于 2019-11-30 08:08:19
I have an app that uses a service to get some icons. With this service I can get any image of any size, so I've planned to get the 3 images (@1x, @2x and @3x) and store them on the BBDD, and then get the scale to use one of these three; or maybe get only the one according with the device scale. But the thing is, how can I get the device scale (@1x, @2x and @3x) programmatically? Both Obj-c and Swift are welcomed ;) iphonic Use [UIScreen mainScreen].scale; this will give you the exact scale as per device. In Swift 3 UIScreen.main.scale Cheers. 来源: https://stackoverflow.com/questions/30572426

How should retina/normal images be handled when loading from URL?

那年仲夏 提交于 2019-11-30 07:37:06
I understand how to programmatically load images for my app from a URL instead of packaging them within the app but how do I handle the 1x vs 2x issue? I can serve both versions from the external source if need be but how do I handle that when setting the UIImage? I'm pretty sure you cannot load @2x image files remotely in an automated way. You will have to test for the retina display and then get the appropriate image(s), like so: UIImage *image; if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] && [[UIScreen mainScreen] scale] == 2){ // @2x NSURL *imageURL = [NSURL

iOS app non-retina and retina images concept

时光怂恿深爱的人放手 提交于 2019-11-30 05:13:39
I am asking this question just for information and to clear my concepts about images in iOS application ( Retina and non-retina devices). What I currently do is When I develop an iPhone application and I have to show an image lets say on UIButton using Interface builder I take two images lets suppose submit.png button image of following sizes 100x100 px (submit.png) 200x200 px (submit@2x.png) for retina display And in Interface builder I will set the size of UIButton 100x100 px and its just works perfectly. Question: Why don't we place only single image lets say submit.png 200x200 px (submit

How can I use high resolution custom markers with the scale parameter in Google's Static Maps API?

血红的双手。 提交于 2019-11-30 04:44:50
We're using Google's Static Maps API with the scale parameter to display lovely smooth maps for people using high resolution displays. However, we'd also like to use custom icons to show points on the map. Unfortunately I can't find any way of doing this that doesn't give pixelated icons like in this example . Is there a way of doing this that doesn't scale the icons up? The &markers parameter now has an (undocumented) scale descriptor. Set that to 2 and the icon descriptor to your @2x marker image URL while using the &scale=2 parameter. Something like: &markers=scale:2|icon=icon@2x.png&scale

cocos2d iphone 5 4 inch display support

主宰稳场 提交于 2019-11-30 04:05:36
I have been looking everywhere for this but with no luck. How do I prepare my cocos2d based game for bigger 4 inch display of the iPhone 5? My app is working but i want to enhance it for the bigger 4 inch display. Cocos2d uses its own suffixes for retina display images. For retina display of the iPhone 4 and 4S it is image-hd.png . Is there a suffix for iPhone 5? How do I accomplish this? Cheers. user2052384 Add it to AppDelegate: [CCFileUtils setiPadRetinaDisplaySuffix:@"your suffix"]; [CCFileUtils setiPadSuffix:@"your suffix"]; [CCFileUtils setiPhoneFourInchDisplaySuffix:@"your suffix"];

Reduce the Xcode Simulator (Retina 4 inch)

一世执手 提交于 2019-11-30 01:41:59
I'm using macbook Air and using the iphone Simulator. I changed it to Retina 4 inch, and the screen of the simulator become so big! is there a way to reduce the size? You can scale it with the following shortcuts: ⌘ + 1 : 100% ⌘ + 2 : 75% ⌘ + 3 : 50% ⌘ + 4 : 33% ⌘ + 5 : 25% Or in iOS Simulator: Window > Scale > ... The iOS Simulator's Window menu has an option to display the simulator at 50%, 75%, or 100%. Try one of the smaller values to make it fit. Now It's more flexible with Xcode 9-Simulator. You can pick & drag any corner or simulator to resize it and set it according to your requirement

IE8 fix for background-size property? Retina Image

℡╲_俬逩灬. 提交于 2019-11-29 23:17:10
I am using the following CSS for Retina images and it works perfectly in FF, Chrome, Safari but not in IE. Is there a fix for IE for using background-size - and if so, how could I implement it using my current code? CSS: .arrow-big-right { display: block; width: 42px; height: 48px; margin-bottom: 1.8em; background-image: url(arrow-big-right.png); background-repeat: no-repeat; background-size: 42px 48px; } HTML <div class="arrow-big-right"></div> Can someone explain how I fix this for IE? Many thanks for any help :-) Josh Davenport IE8 and below simply don't support background-size so you're

IE8 fix for background-size property? Retina Image

这一生的挚爱 提交于 2019-11-29 23:15:17
I am using the following CSS for Retina images and it works perfectly in FF, Chrome, Safari but not in IE. Is there a fix for IE for using background-size - and if so, how could I implement it using my current code? CSS: .arrow-big-right { display: block; width: 42px; height: 48px; margin-bottom: 1.8em; background-image: url(arrow-big-right.png); background-repeat: no-repeat; background-size: 42px 48px; } HTML <div class="arrow-big-right"></div> Can someone explain how I fix this for IE? Many thanks for any help :-) Josh Davenport IE8 and below simply don't support background-size so you're

CATiledLayer in iPad retina simulator yields poor performance

大城市里の小女人 提交于 2019-11-29 20:12:37
I'm hoping maybe this is just an issue with the simulator but of course it has me worried since I have already submitted my retina capable apps and there's no way to test it until the 16th. I have implemented a CATiledLayer in my app to view very large maps. The tiles for the map are coming from the internet, however they also get cached, so, typically, they are actually being loaded directly from the device. On iPad 1 and iPad2 it works beautifully. You can only barely notice the tiles being rendered on the iPad 2, even when they are coming from the internet. On the iPad Simulator it works

Interface Builder degrades storyboards, resizes and repositions views in small increments

ε祈祈猫儿з 提交于 2019-11-29 20:07:51
We have a number of iOS apps that several different developers contribute to. A problem that I continue to notice is that views in our storyboards will shift out of the position they were put in or resize so that they are smaller, which on labels that were sized to fit text originally becomes painfully obvious when the labels all of a sudden are truncating their text. I'm noticing these degradations of our views appear in commits to our Git repository when the developer did not directly make any edits to the storyboard. They may have viewed the storyboard in Interface Builder, but did not make