TAILIEUCHUNG - Lập trình ứng dụng cho iPhone part 15

Creating advanced view controllers Khi chúng tôi bắt đầu nhìn của chúng tôi tại điều khiển xem trong chương 13, chúng tôi hứa rằng chúng tôi muốn quay trở lại xem các bộ điều khiển cao cấp hơn mà quản lý một vài trang nội dung cùng một lúc. Đó là mục đích của chương này: để giới thiệu bạn đến các khối xây dựng cơ bản cuối cùng của hệ điều hành iPhone, cho phép bạn xây dựng ứng dụng nhiều trang phức tạp. Trong chương này chúng tôi sẽ có một cái nhìn sâu tại hai bộ điều khiển. | Creating advanced view controllers This chapter covers Tab-based interfaces Navigation-based interfaces The flipside controller When we started our look at view controllers in chapter 13 we promised that we d return to the more advanced view controllers that manage several pages of content at once. That s the purpose of this chapter to introduce you to the final fundamental building block of the iPhone OS that allows you to build complex multipage applications. In this chapter we ll take an in-depth look at two view controllers the tab bar controller and the navigation controller. We ll also take a briefer look at the flipside controller that appears in one of Xcode s templates and talk about some modal controllers that we ll see in part 4 of this book. As in our previous chapter on view controllers we ll offer some more skeletal examples since our main purpose is to provide you with the reusable programming frameworks that will allow you to use these controllers in your own programs. Let s kick off our discussion with the tab bar view controller. 264 The tab bar view controller 265 The tab bar view controller Of the multipage view controllers the tab bar is the easiest to use because it supports simple navigation between several views. As with all of the advanced view controllers it has a complex underlying structure incorporating several objects that work in tandem. The anatomy of a tab bar controller To function a tab bar view controller requires a hierarchy of at least six objects One UITabBarController A minimum of two UlViewControllers One UITabBar A minimum of two UITabBarltems This hierarchy of objects is depicted in figure . The tab bar controller and its associated view controllers are the heart of this setup. Essentially the tab bar controller switches off between different pages each of which uses a view controller to manage its events. In Xcode you d have to create and hook up these view controllers by hand while in Interface Builder .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.