retina-display

How to programmatically get iOS status bar height

谁都会走 提交于 2019-11-27 16:35:48
I know that currently the status bar (with the time, battery, and network connection) at the top of the iPhone/iPad is 20 pixels for non-retina screens and 40 pixels for retina screens, but to future proof my app I would like to be able to determine this without hard coding values. Is it possible to figure out the height of the status bar programmatically? Kyr Dunenkoff [UIApplication sharedApplication].statusBarFrame.size.height . But since all sizes are in points, not in pixels, status bar height always equals 20. Update. Seeing this answer being considered helpful, I should elaborate.

LESS CSS set variables in media query?

感情迁移 提交于 2019-11-27 14:56:02
I'm working on a iPad-specific website. To make my website work on both the retina display iPad and older versions of iPads, I want to set a variable in LESS CSS in media query like: @media all and (max-width: 768px) { @ratio: 1; } @media all and (min-width: 769px) { @ratio: 2; } So when you are setting anything in pixels, you can do width: 100px * @ratio; But I got a compile error saying @ratio is not defined. Is it possible to have a workaround to make it work? Thanks. It would be nice, but this is impossible to do like this. LESS compiles your media queries to actual media queries, so at

Canvas drawing and Retina display: doable?

淺唱寂寞╮ 提交于 2019-11-27 14:54:15
问题 Working with phoneGap implementing drawing with Canvas. The catch we've run into is that canvas expects specific pixel dimensions. This is fine except that the iPhone 4's Retina display, from a CSS/Webkit POV is still 320px wide, even though technically there are 640 actual screen pixels. Is there anyway to accommodate the retina display using Canvas on Webkit while preserving compatibility with non-retina displays? 回答1: I sat with the same problem last week and discovered how to solve it -

Apple Retina Display Support in Java JDK 1.7 for AWT / Swing

穿精又带淫゛_ 提交于 2019-11-27 13:36:35
问题 I just became aware that AWT / Swing under Java JDK 1.7 (as of JDK 7u15) does not support Retina displays on Apple Macbook Pros. Netbeans, for example, is nearly unbearable to use for more than a few minutes running on a Retina display and using JDK 1.7. This has been somewhat addressed in a StackExchange question here, and quoting one specific post: Apple's Java 6 JRE will support HiDPI, however it is not currently supported by Oracle's Java 7 JRE. It also doesn't work under the latest dev

Images for iphone 5 retina display

自作多情 提交于 2019-11-27 12:48:36
iPhone 5 released, with new screen size and resolution. When we used images for iPhone 4 (retina), we just added "@2x" to image name. Can anybody tell me, is it possible to add different images (backgrounds, buttons, etc), for new iPhone screen? And the second question: can I have in my app separate XIB files: for iPhone old, iPhone new (like for iPhone and iPad)? Thank you! Ben Clayton Here's an except from my blog about this subject: [UIImage imageNamed:] automatically loads @2x versions of images when running on a retina device. Unfortunately, imageNamed: will NOT automatically load -568h

iPhone 5 - what naming convention the new images have to follow?

倾然丶 夕夏残阳落幕 提交于 2019-11-27 11:19:51
What name convention the new images have to have to be loaded by the new iPhone 5? We see that we have to have 3 default images to be loaded by the device Default.png Default@2x.png and Default-568h@2x.png what about the other images used by an app? Is there a naming convention that will automatically load the correct image? jsd The new default is Default-568h@2x.png. (note hyphen) There is no other corresponding change. If you need a different image for the new iPhone 5 screen then you have to create it as a separate name. There is no 1x/2x/new phone auto switching behavior. If you are

CSS for high-resolution images on mobile and retina displays

天大地大妈咪最大 提交于 2019-11-27 10:59:04
问题 My website images look blurry for users with retina displays. (For example, on the Retina MacBook Pro). How do I serve high-resolution images to visitors with retina displays, but standard-sized images to everyone else, while keeping the image the same apparent size? 回答1: In your HTML, create a <div> like so: <div class="ninjas-image"></div> And in your CSS, add: .ninjas-image { background-image: url('ninja-devices.png'); width: 410px; height: 450px; } @media (-webkit-min-device-pixel-ratio:

Pixel density, retina display and font-size in CSS

牧云@^-^@ 提交于 2019-11-27 10:56:32
问题 I don't have a Retina MacBook myself to test these things out, and there seems to be a lot of confusion on the internet about web design on high pixel density displays. Now, I assume that WebKit on a MacBook with Retina display scales the page about twice it's size as most web pages are not built to adapt to the higher pixel density? In my view the ideal case when designing for these, or actually any type of display is to use ems instead of pixels as you could just do; @media only screen and

UIWebView and iPhone 4 retina display

寵の児 提交于 2019-11-27 10:52:13
问题 I have a UIWebView which displays some local text and images. Either I've made a mistake somewhere, or the UIWebView doesn't automatically handle the @2x suffix for high resolution images. So, my question is has anyone else successfully loaded @2x images into a UIWebView through the normal means, or do I need to do something special? Can I somehow detect if my user has a retina display? 回答1: As per your request... Test for functionality. If you want to know if you need to display a retina

Automatic Retina images for web sites

大兔子大兔子 提交于 2019-11-27 08:58:12
问题 With the new Apple MacBook Pro with retina display, if you provide a "standard" image on your website, it'll be a little fuzzy. So you have to provide a retina image. Is there a way to automatically switch to @2x images, like iOS (with Objective-C) does? What I've found is: CSS for high-resolution images on mobile and retina displays, but I wish I could find an automatic process for all my images, without CSS or JavaScript . Is it possible? UPDATE I would emphasize this interesting article