Sizes of iPhone UI Elements

from:http://blog.csdn.net/hairetz/archive/2009/04/30/4141043.aspx

 

http://www.idev101.com/code/User_Interface/sizes.html

 

ElementSize (in pixels)
Window (including status bar)320 x 480px
Status Bar
(How to hide the status bar)
20 px
View inside window 
(visible status bar)
320 x 460
Navigation Bar44 px
Nav Bar Image /
Toolbar Image
up to 20 x 20 px (transparent PNG)
Tab Bar49 px
Tab Bar Iconup to 30 x 30 px (transparent PNGs)
Text Field31 px
Height of a view inside 
a navigation bar
416 px
Height of a view inside 
a tab bar
411 px
Height of a view inside 
a navbar and a tab bar
367 px
Portrait Keyboard height216 px
Landscape Keyboard height140 px

Viewing / Adjusting Sizes in Interface Builder

Sizes for specific UI elements (buttons, text fields, images, etc.) can be adjusted in the size panel of the Inspector window ( ↑⌘I):
iconshortcut 
⌘3Size is the size and location (in X,Y coordinates) of the object on screen.

Size (and location) can also be adjusted programmatically:

[button setFrame:CGRectMake(x, y, width, height)];

The x, y position refers to the top left corner of the view being positioned.

Frame and Bounds

The frame is the outer container for the view - the position of the item within its enclosing superview. x is the distance left-right, where x = 0 is the left side. y is the distance up-down, where y = 0 is the top of the frame.

The bounds rectangle determines the origin and scale in the view's coordinate system within its frame rectangle. Setting this property changes the value of the frame property accordingly.

When you set the frame property, the size of the bounds property is set to match the size of the frame property. The center property is also adjusted to match the center point of the new frame.

Additional References

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值