Trong tất cả các quán bar iPhone, chỉ có các lớp học UIToolbar có nghĩa là sử dụng trực tiếp. Nó cung cấp một loạt các nút tương tự như điều khiển phân đoạn, nhưng với một cái nhìn khác nhau (xem hình 4-3, dưới) Thanh công cụ được giới hạn trong một vai trò tạm thời làm nổi bật | Display and Interaction Traits 235 define PI - void loadView contentview UlView alloc initWithFrame CGRectMake contentView setCenter CGPointMake contentView setBackgroundColor UIColor blackColor contentView setTransform CGAffineTransformMakeRotation PI contentView contentView release For the most part it s far easier using UIViewControllers to work with reorientation events than manually rotating and presenting manual view rotation does not change the status bar orientation nor the keyboard orientation. Chapter 4 discusses view controllers and reorientation in depth. Display and Interaction Traits In addition to physical screen layout the UIView class provides properties that control how your view appears onscreen and whether users can interact with it. Every view uses a translucency factor alpha that ranges between opaque and transparent. Adjust this by issuing myView setAlpha value where the alpha values falls between fully transparent and fully opaque .This is a great way to hide views and to fade them in and out onscreen. You can assign a color to the background of any view. myView setBackgroundColor UIColor redColor colors your view red for property affects different view classes in different ways depending on whether those views contain subviews that block the background. Create a transparent background by setting the view s background color to clear . UIColor clearColor . Every view however offers a background color property regardless of whether you can see the background. Using bright contrasting background colors is great way to visually see the true extents you re new to iPhone development coloring in views offers a concrete sense of what is and is not onscreen and where each component is located. The userInteractionEnabled property controls whether users can touch and interact with a given view. For most views this property defaults to