Considerations for creating third-generation iPad apps

I am currently making an iPad app that has created views for the iPad 2. However, now that the iPad came out with double the resolution, I need to support that as well. Pls talk directly about what changes to make to the app to support iPad 2 and iPad 3rd generation. The only way I can think of is programmatically managing the view frames and laying out the subzones, which would be a nightmare :-). Pls help if there is a better, more scalable way to do this.

Thanks for your help in advance.

+3


source to share


2 answers


You don't need to change the scope of your views. The only thing to do is add the dual-resolution versions of the images you are using.

So, if you have an image named MyImage.png

with size 100x100

, add a new image named MyImage@2x.png

with size 200x200

.



No code to change. If you agree to the convention to add a suffix @2x

to your image names, then the correct image (standard or high definition) will be used according to the device's screen resolution.

Finally, don't forget to add icons and run images with the correct dimensions for your new iPad.

+4


source


In the documentation titled " View iOS Programming: View Geometry and Coordinate Systems " you will find this:

Viewing Geometry and Coordinate Systems

The default coordinate system in UIKit has its origin at the top-left corner and has axes that extend down and to the right of the origin point. Coordinate values ​​are represented using floating point numbers, which allow accurate layout and positioning of content regardless of the underlying screen resolution . Figure 1-4 shows this system coordinate relative to the screen. In addition to the screen coordinate, the system, windows and views define their own local coordinate systems which allow you to specify coordinates relative to the view or window origin, rather than relative to the screen



In other words, you are not programming the pixel dimensions of the view, and the existing dimensions are automatically converted to match the underlying screen resolution.

In addition, with retina display, you can provide double the resolution image files to display unglazed ordinals and use the @ 2x name suffix in the image name.

0


source







All Articles