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

 

Sizes of iPhone UI Elements_第1张图片

Element Size (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 Bar 44 px
Nav Bar Image /
Toolbar Image
up to 20 x 20 px (transparent PNG)
Tab Bar 49 px
Tab Bar Icon up to 30 x 30 px (transparent PNGs)
Text Field 31 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 height 216 px
Landscape Keyboard height 140 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):
icon shortcut  
⌘3 Size 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

  • The UIBarButtonItem Class Reference says "Typically, the size of a toolbar and navigation bar image is 20 x 20 points."
  • The UITabBarItem Class Reference says "The size of an tab bar image is typically 30 x 30 points."

你可能感兴趣的:(UI,image,iPhone,interface,keyboard,distance)