I am new to iOS, how to find what is the resolution of iPad.
Googling resulted me to choose 748*1024, is this value represents in pixels? Or
do we have any alternate measurement unit?
Did you know you can change the resolution of the iPad in the simulator?
Just choose from the "Device" submenu within the "Hardware" menu:
And the resolution that corresponds to these devices should correspond to the values you have already Googled up.
As for the unit of measurement, even Apple's iPad specs (linked here for you) mention Pixels. Apple is trying to get developers away and off the idea of thinking in pixels (because we have to plan for screens of different sizes and resolutions), but Apple still uses that "pixel" measurement themselves.
Related
I have a graphic designer who is doing some graphics for my iPhone app. Most recently she made me a background pattern and posed me two questions that I'm unsure of how to answer:
1) What should the size of the background pattern be?
-For this I know that when I'm programming my app,the screen is in terms of 320 by 480 (when in portrait mode), however is this the appropriate unit that I should give her (I'm only worried about iPhone 4 and below for now)? Like for instance, I know there is a retina display and I've seen the phone resolution of my phone also be listed as 640 x 960. I'm just confused of what the best thing to tell her regarding this is, she does not have any iPhone experience and will be using the traditional graphic programs like illustrator, photo shop etc to do the graphic design.
2) What file type should it be?
-I've read the iPhone supports mostly all of the most popular graphic file types, but is there anyone particular that would work best on an iPhone app?
The standard for iPhone resource images is PNG. If you want to target iPhone 4+ with retina display, have the designer provide two versions of the PNG: A standard version and a double-sized version which should have #2x appended after the filename, but before the extension.
So
image.png
for regular resolution and
image#2x.png
for retina resolution. iOS will automatically pick the best one to use based on the screen available.
There are people who insist that for changing design from TFT to Retina we should redesign all app.
But I have read that we can change only app's images ,and it's enough.
I want to know which is the best practice for it and which solution is acceptable??
Retina Display is just Apple's name for the high resolution display on some of its devices -- it's still a TFT (thin film transistor) LCD display, though.
The Retina Display has twice as many pixels in each direction as the non-Retina version. iOS features a mechanism for providing both high resolution and standard resolution images, so that the high-res versions will be used if needed. All you need to do is include high-res versions of your images with the same names and their standard-res counterparts and the "#2x" suffix. Of course, having that higher resolution available means that you might want to add detail to your images or otherwise redesign your app to take full advantage of the screen's capabilities, but it's not a requirement. In fact, you don't need to do anything at all -- your existing app will work just fine without any changes.
It depends on your app.
In many cases simply including the hi-res versions of your images will be all that you need to do.
However, if you have any custom drawing that could benefit from the extra resolution, then you'll need to considered updating that code too.
In the Flash CS 5.5 AIR settings for iOS, in the General tab of a panel, there's a menu that lets you specify the target device:
iPhone;
iPad;
(both) iPhone and iPad;
What happens if I specify the third?
That is: I can't understand if I can use the default stage dimensions (iPhone dimensions) or I must eventually create a stage (and assets) for iPad (and it will work for iPhone too).
Can't find any documentation.
I guess the best way to find out is to actually try it out!
Many apps that work on both iPad and iPhone use the default stage dimensions and just resize the whole thing 2x when on an iPad. Although I haven't tried it with an AIR app, I would say the same behavior should be expected.
I'm hoping to recursively change every single View in my application to use the iPhone 4 graphics, and change the content scale factor to 2.0, such that it's the zoomed in version of my iPhone application on the iPad by default.
Currently, the iPad starts out in x1 Zoom, which is the 320x480 pixel version displayed on the 1024x768 real estate of the iPad, where the powers that be have declared that they're too cheap to actually invest in an iPad app, instead requesting that we have the application use iPhone retina graphics with a default content scale factor of 2.0
Upon googling and searching stackoverflow it seems my query is unique, though some questions are sort of similar such as -> Problem adapting scale factor for iPad x2 compatibility mode
And the best way to go about doing this remains undocumented, so I hope to implement this 'hack' so to speak in the best most succinct way possible.
If anyone has done this before, please share the code, otherwise I will update this with my own answer once I've figured it out.
The Answer: THIS CANNOT BE DONE.
The iPad will treat the screen as 480x320, even at 2x, so even if you change the contentScaleFactor appropriately and force it to use #2x.png images, you won't get any better resolution.
This is built into the iphone Operating system, only the Jailbroken iPads can get around this. Which isn't an option to consider.
It's easier to just duplicate the target for iPad, and realign the nib files appropriately, and make the app a Universal App.
It's a daft idea, and even if Apple change this in future SDK releases, it won't be backward compatible which again isn't an option, at least for our development team.
I think the best way to do it rules out using nib files.
If you create your views in code, you can easily use conditional code ([[UIDevice currentDevice] userInterfaceIdiom]) and based on that set the scale for the UIView elements.
How is it possible to accommodate lower resolutions from Corona but primarily target high resolution devices?
I know you can specifically set content width and height via Corona, and scale the content, but this seems to be for scaling upwards (method detailed here http://blog.anscamobile.com/2011/01/use-dynamic-layouts-in-universal-builds-with-corona-sdk/).
I've been creating an iPad app but I'd not targeted any resolution - my app appears fine on iPad 1 / 2 and on iPhone 4, but not on the original iPhone.
There are two terms you need to pay attention to: dynamic content scaling and dynamic image resolution. The former refers to scaling the stage in Corona to fit on different displays, and the latter refers to swapping different versions of images on different displays. Here's documentation about both:
http://blog.anscamobile.com/2010/11/content-scaling-made-easy/#more-3756
http://developer.anscamobile.com/content/configuring-projects#Dynamic_Image_Resolution
First setup dynamic content scaling in config.lua so that the display will scale on different devices.
Then setup dynamic image resolution (also set in config.lua) so that you can swap in higher resolution versions of your graphics on devices with higher resolution. This is done through naming of the image files; basically, when you call newImageRect("image.png") in your code, it'll load image.png on lower resolution devices and image#2x.png on higher res devices.
(incidentally, while the dynamic image resolution configuration on the linked page uses the suffix "#2" I would recommend "#2x" because that is the standard suffix Apple uses. That is, in Corona you don't have to use Apple's standard, but it's less confusing if you do.)