retina-display

iPhone6 Display Zoom Functionality disturbs the whole view

你。 提交于 2019-11-29 20:03:02
问题 I'm faces a problem with iPhone6' Display Zooms functionality, as on Xcode 6.1.1 simulator don't have Display Zoom functionality to test and its have standard display only. Problem: When I run my code on simulator and iPhone6 (with standard display) its work fine, but when I run my code on the iPhone6 (with Display Zoom functionality on) then my whole view disturbs from its original position and even UIButton are not even display or hide in this case. Here are the two images of my scenario:

Why does iOS auto layout lead to apparent rounding errors on pre-Retina displays (unit test included)

谁说我不能喝 提交于 2019-11-29 17:30:00
问题 I'm currently having a hard time understanding why the following unit test fails on an iPad 2. Auto layout seems to slightly (by 0.5 points) mis-position view inside superview relative to the exact centering that's required by two layout constraints. What seems especially strange is that the crucial test (but-last assertion) passes on an iPhone 5, so the apparent rounding error affects only one (iOS 6) platform. What's going on here? UPDATE 1 I've changed the code to ensure that that both

How to find real display density (DPI) from Java code?

帅比萌擦擦* 提交于 2019-11-29 16:17:14
I'm going to do some low-level rendering stuff, but I need to know real display DPI for making everything of correct size. I've found one way to do this: java.awt.Toolkit.getDefaultToolkit().getScreenResolution() — but it returns incorrect result on OS X with "retina" display, it's 1/2 of the real DPI. (In my case it should be 220, but it's 110) So either some other, more correct API must be available, or alternatively I need to implement a hack just for OS X — somehow find if the current display is "retina". But I couldn't find any way to query for this information too. There's this answer

Not including non-retina display images in an iPhone project

本秂侑毒 提交于 2019-11-29 11:20:10
I have an iPhone Xcode project that currently only contains images for retina display (twice the size as normal and with a @2x.png suffix). When I run the app on the iPhone Simulator (non retina) the images are still being displayed. Does this mean I don't need to worry about including two sets of images: retina and non-retina? This all seems a bit odd. I would assume that no images would appear on a non retina device if there are no non-@2x files included. Note: I have not tested my app on a non retina device. Just the simulator. Even if it works, it's not good practice, and if you have a

When I run iPhone app on iPad the screen resolution is wrong. How to fix this?

送分小仙女□ 提交于 2019-11-29 11:15:26
I encountered with a strange problem. I develop an application which is targeting iPhone device family with Retina 3.5 and 4. All the time I used iPhone 5 simulator to test all the UI and functionality and everything was good but know I have to test push notifications. I have iPad 4 (model MD522ZP/A) as an iOS 6 device. When I run my app on it all the UI layout became wrong. The most weird problem is when I tried to check display resolution with this code: NSLog(@"RESOLUTION = %@", NSStringFromCGSize([UIScreen mainScreen].bounds.size)); I got this : RESOLUTION = {320, 480} . But it is iPhone 3

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

三世轮回 提交于 2019-11-29 10:42:07
问题 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 ;) 回答1: Use [UIScreen mainScreen].scale; this will give you the exact scale as

How to use srcset and sizes for responsive images

旧城冷巷雨未停 提交于 2019-11-29 10:18:14
I have following snap-points: 480px , 900px , 1800px , 2400px . and this markup: <img sizes="(max-width: 2400px) 100vw, 2400px" srcset=" boat-480.jpg 480w, boat-900.jpg 900w, boat-1800.jpg 1800w, boat-2400.jpg 2400w" src="boat-2400.jpg" alt="This is a boat"> How should I get responsive images to work? 1. Basics Device-pixel ratio Device-pixel ratio is the number of device pixels per CSS pixel which is related to: Pixel density of the device (number of physical pixels per inch) Zoom level of the browser So, greater Pixel density and/or higher Zoom level results in higher Device-pixel ratio .

Do PNGs (or JPGs) have a DPI? Or is it irrelevant when building for retina?

六眼飞鱼酱① 提交于 2019-11-29 09:32:14
A simple question that I have been having great difficulty finding a definitive answer to: do PNG files have a DPI? Or perhaps more importantly, is it even relevant when building retina-enabled sites/apps? I've just received PSD assets from our designer for a retina iPad app that I must convert into HTML for display within the app. Typically, I receive such files as 2048x1536 @ 72 DPI -- double size but standard screen DPI. I then typically use CSS to tell the browser how to display it. But this time the designer was instructed to provide his PSDs at 1024x768 @ 144 DPI (standard size but

openGL ES retina support

自古美人都是妖i 提交于 2019-11-29 07:12:32
I'm trying to get the avTouch sample code app to run on the retina display. Has anyone done this? In the CALevelMeter class, I've tried the following: - (id)initWithCoder:(NSCoder *)coder { if (self = [super initWithCoder:coder]) { CGFloat f = self.contentScaleFactor; if ([self respondsToSelector:@selector(contentScaleFactor)]) { self.contentScaleFactor = [[UIScreen mainScreen] scale]; } f = self.contentScaleFactor; _showsPeaks = YES; _channelNumbers = [[NSArray alloc] initWithObjects:[NSNumber numberWithInt:0], nil]; _vertical = NO; _useGL = YES; _meterTable = new MeterTable(kMinDBvalue);

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

橙三吉。 提交于 2019-11-29 02:41:30
问题 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? 回答1: The &markers parameter now has an (undocumented) scale descriptor. Set that to 2 and the icon descriptor to your @2x