iPhone和iPad下各种常见控件的宽度和标准是一样的,所以这里就用iPhone说明。
Sizes of iPhone UI Elements
总结
Points vs. Pixels
Element Size (in points) Window (including status bar) 320 x 480 pts Status bar
(How to hide the status bar)20 pts VIEw insIDe window
(visible status bar)320 x 460 Navigation bar 44 pts Nav bar Image /
Toolbar Imageup to 20 x 20 pts (transparent PNG) Tab bar 49 pts Tab bar Icon up to 30 x 30 pts (transparent PNGs) Text FIEld 31 pts Height of a vIEw insIDe
a navigation bar416 pts Height of a vIEw insIDe
a tab bar411 pts Height of a vIEw insIDe
a navbar and a tab bar367 pts Portrait Keyboard height 216 pts Landscape Keyboard height 140 pts
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 dimensi***** 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 versi***** of the images in your project. See the checklist for updating to iOS4 or Apple documentation for Supporting High Resolution Screens for more info.
Adjusting Sizes
Click here to see how to adjust View Frames and Bounds.
Additional References
Apple documentation: Points vs. Pixels Apple documentation: UIBarButtonItem Class Reference says "Typically,the size of a toolbar and navigation bar image is 20 x 20 points." Apple documentation: UITabBarItem Class Reference says "The size of an tab bar image is typically 30 x 30 points."
以上是内存溢出为你收集整理的[iOS] iPad与iPhone上各种标准控件的大小全部内容,希望文章能够帮你解决[iOS] iPad与iPhone上各种标准控件的大小所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)