tailieunhanh - iOS 5 Programming Cookbook phần 5

Bạn muốn hiển thị nội dung trên iPad mà không ngăn chặn toàn bộ màn hình Popovers được sử dụng để hiển thị thêm thông tin về màn hình iPad. Một ví dụ là các ứng dụng Safari trên iPad. Khi người sử dụng vòi nước vào nút Bookmarks, cô | Figure 4-13. Selecting the navigation controller in Interface Builder Figure 4-14. Selecting a navigation controller as the initial view controller of a storyboard As you can see now your navigation controller has a border around it. Now if you run your application you will notice that the initial view controller has a navigation bar on 340 Chapter 4 Storyboards top indicating that this view controller now has a navigation controller. In the next recipes we will see how we can make use of the navigation controller to display new scenes on the screen. Figure 4-15. The navigation bar on a view controller created with a storyboard We now have a navigation controller with a view controller inside it but our objective now is to trigger an action and then move from one view controller to another. Alright then let s place a button on our view controller and push a view controller into the stack once the user presses the button. Sounds good Alright let s get started Adding a Navigation Controller to a Storyboard 341 1. Go back to your .storyboard file. 2. In the Object Library find the View Controller object see Figure 4-16 and drag and drop it onto the storyboard on the right side of our existing view controller as shown in Figure 4-17. Figure 4-16. A view controller object in the Object Library 342 Chapter 4 .