不同分辨率下页面的控件大小调整(待完善)
来源:互联网 发布:idm mac破解版 编辑:程序博客网 时间:2024/06/11 03:51
Retina: 960×640的分辨率压缩到一个3.5英寸的显示屏内。
ios4/ios4s 2010/2011
Screen Res 960×640
Screen Size (inches) 3.5
ios5 2012
Screen Res 1136×640
Screen Size (inches) 4
像素定义:像素是指基本原色素及其灰度的基本编码。
分辨率(resolution)就是屏幕图像的精密度,是指显示器所能显示的像素的多少。由于屏幕上的点、线和面都是由像素组成的,显示器可显示的像素越多,画面就越精细,同样的屏幕区域内能显示的信息也越多,所以分辨率是个非常重要的性能指标之一。可以把整个图像想象成是一个大型的棋盘,而分辨率的表示方式就是所有经线和纬线交叉点的数目。
为了方便开发人员开发,iOS 中统一使用点(Point)对界面元素的大小进行描述。(pts)
所以对于不同分辨率下的界面编写,只需把屏幕大小都当成 320 x 480点 进行开发即可,点跟像素的换算关系如下:
普屏 1点 = 1像素
Retina屏 1点 = 2像素
直接通过 [[UIScreen mainScreen] bounds] 即可获取到当前屏幕的基础分辨率,所以不用 hard code。
而元素的位置相对当前屏幕设定
http://www.zhihu.com/question/20583941
个人设置:
Button 40×80
TextField 40×100
Label 40×80
控件尺寸
http://dangpu.sinaapp.com/?p=59
Points VS. Pixels
The iPhone 4 introduced a high resolution display with twice the pixels of previous iPhones. However you don't have to modify your code to support high-res displays; the coordinate system goes by points rather than pixels, and the dimensions in points of the screen and all UI elements remain the same.
iOS 4 supports high resolution displays (like the iPhone 4 display) via the scale property on UIScreen, UIView, UIImage, and CALayer classes. If the object is displaying high-res content, its scale property is set to 2.0. Otherwise it defaults to 1.0.All you need to do to support high-res displays is to provide @2x versions of the images in your project. See the checklist for updating to iOS4 or Apple documentation for Supporting High Resolution Screens for more info.
Iphone4 的显示是以前iphone两倍像素的分辨率。但是你不用修改你的代码来支持更高的显示效果;因为系统的协调模块描述显示使用点(point)而不是像素,而屏幕和所有UI控件上点的量度是保持不变的。
不是专业翻译,省略以下...
- 不同分辨率下页面的控件大小调整(待完善)
- 按分辨率不同调整对话框大小以及控件大小
- android linearLayout 根据不同的分辨率自动调整 显示大小
- PB让窗口在不同的分辨率下自动调整大小
- PB让窗口在不同的分辨率下自动调整大小函数
- 自定义控件(详解_待完善)
- 调整linux的分辨率 桌面大小
- Easyui widow 控件 宽度调整适应不同分辨率
- [EMWIN]不同窗口的ID实验 [待完善]
- 调整控件字体的大小
- ssh的下页面分发
- 不同分辨率下Icon的大小
- 不同分辨率下BCB中保持控件的位置及大小
- [剑指offer][面试题44]扑克牌的顺子(待完善)
- 多线程 面试题总结 14题(待完善)
- 一元多项式的运算 (待完善)
- shodan搜索引擎的运用(待完善)
- Android_apk的安装(待完善)
- Javascript学习笔记-----函数
- openstack nova 之 quota(配额管理)
- 系统jvm调整经验(marjo担保失败)
- iOS app 名字的多国语言本地化
- Java学习历程(关于最大公约数和最小公倍数)
- 不同分辨率下页面的控件大小调整(待完善)
- 设计模式学习总结——前言
- policy机制中经典的python用法
- 二维数组中的查找
- 加载完成提醒
- ORA-28000: the account is locked-的解决办法
- Excel导入导出
- 希尔排序法
- openstack nova 基础知识——policy