【iphone开发书籍大全】 beginning iphone sdk programming with objectivec 部分3.pdf


文档分类:IT计算机 | 页数:约109页 举报非法文档有奖
1/109
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/109
文档列表 文档介绍
【iphone开发书籍大全】 beginning iphone sdk programming with objectivec_部分3Tab Bar Applications ❘ 189
FIGURE 8-7
The Tab Bar Controller contains a collection of View Controllers. In this case, there are two view con-
trollers contained within it. The fi rst view controller inside the UITabBarController instance is always
displayed when it is added to the current view:
- (void)applicationDidFinishLaunching:(UIApplication *)application {

// Add the tab bar controller's current view as a subview of the window
[window addSubview:];
}
When the user touches the Tab Bar items, each corresponding view controller is loaded to display
its view.
NOTE Another way to view the window is to switch it to
display in List View (the second button at the top left corner of the window).
Doing so allows you to quickly inspect the collection of View Controllers
contained in the Tab Bar Controller.
190 ❘ CHAPTER 8 TAB BAR AND NAVIGATION APPLICATIONS
Adding Tab Bar Items
The previous section demonstrated how to create a Tab Bar application using the template provided
by the SDK. By default, the application template includes only two Tab Bar items, so in this section,
you see how to add more Tab Bar items to the existing Tab Bar.
TRY IT OUT Adding Tab Bar Items
1. Using the same project, in Interface Builder, drag and drop a Tab Bar item from the Library onto
the Tab Bar view (see Figure 8-8).
FIGURE 8-8
2. Select the newly added Tab Bar item and view its Attributes Inspector window. Set the Badge
property to 5 and the Identifi er property to Search. (see Figure 8-9). Observe the change in
appearance of the Tab Bar item.
NOTE Click the center of the Tab Bar item so that the Tab Bar item can be
selected; if you click the outside, the View Controller is selected.
Tab Bar Applications ❘ 191
FIGURE 8-9

【iphone开发书籍大全】 beginning iphone sdk programming with objectivec 部分3 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数109
  • 收藏数0 收藏
  • 顶次数0
  • 上传人rovend
  • 文件大小6.93 MB
  • 时间2021-06-20