Iphone how to build UI for both resolutions 640X960 and 320X480?
来源:互联网 发布:ieee编程语言排行榜 编辑:程序博客网 时间:2024/06/05 04:48
问:
since iPhone 4 now has 640X960 resolution i am confused how to build a proper UI for both 320 X 480 and 640 X 960 resolutions.. if i only use images and stuff of 640X960 resolution will it automatically adjust itself for smaller resolution iPhones.. if not what is the best way to differentiate on basis of device resolution??
答:
You make 2 of each image - the first one at normal scale and named the usual "whatever.png". Then you make a second hi-res version of that image at double the scale and name it "whatever@2x.png". Then, iOS will handle the rest. You'll add both of those images to the project, and anywhere in the code that you reference "whatever.png", the system will take care of grabbing and using "whatever@2x.png" when and if appropriate, so you don't have to fuss with much. That's it. Simple.
In Interface Builder, just lay things out like normal using the standard sized graphics. In code as well, just reference images as usual, referring to the standard-sized images. So long as the higher-res counterpart is named with the "@2x.png" appended, everything will just work.
So, just as an example, say you currently have a project with a button image sized 40x100 named "awesomeButton.png". To support the retina resolution, create a new button image sized at 80x200, and name it awesomeButton@2x.png. Import it into your project and iOS takes care of the rest.
- Iphone how to build UI for both resolutions 640X960 and 320X480?
- How to Support MUI (Multi User Interface) for both Vista and XP
- how to build QOCI (for linux and windows)
- How to Build and Use libnetfilter_queue for Android
- The Ultimate Guide To iPhone Resolutions
- The Ultimate Guide To iPhone Resolutions
- The Ultimate Guide To iPhone Resolutions
- How to auto build and deploy project
- How to Download and Build V8
- How to build OpenOCD for windows
- How to Build FFmpeg for Android
- How to build Android adb for ARM
- How to build Android adb for ARM .
- How to Build FFmpeg for Android
- How to Build FFmpeg for Android
- How to Build FFmpeg for Android
- How To Build CyanogenMod Android for smartphone
- how to build DLIB for iOS
- html5网址
- C51编程中根据不同情况在不同空间(data xdata bdata)定义变量的注意事项
- Android 自定义控件 eBook 翻书效果
- SEO图片优化基本技巧
- nginx均衡负载模块里的心跳检测模块,可以自动维护server的状态
- Iphone how to build UI for both resolutions 640X960 and 320X480?
- 为什么java.net.URLEncoder.encode方法要调用两次而不是一次呢?
- Android中的RelativeLyout布局
- 在线学习的特点和优劣分析
- Android 应用开发之vibrator
- 同步和异步的区别
- 在线学习和现场学习的比较
- 这样进行在线学习效果最好
- webkit的js对象扩展(二)——binding方式创建自定义对象(多实例)