IOS development-how to implement tag navigation on the story board

Source: Internet
Author: User

Use the story board technology to implement tag navigation. Use the "Tabbed Application" template to create a project named "TabNavigationStoryborad. Select "Use Storyborads" and "Use Automatic Reference Counting ". After the creation is complete, open MainStoryboard. storyboard. The three Controller Scene will be connected by some lines. These lines are Segue, and you can see whether they think of the "storyboards" in the animated books. In fact, iOS storyboards originated from the animation industry. At the beginning of the story board, the "Tab Bar Controller Scene" is the Root View Controller, there are two sews in the figure that describe the relationship between "Tab Bar Controller Scene" and "First View Controller Scene" and "Second View Controller Scene. We need to modify two existing Scene and then add another Scene to meet our business needs. It is easy to modify two existing Scene. You can modify the View Controller name according to the previous section, and then the Scene will change. Add a Scene to the design screen, as shown in Figure 6-40. Drag a "View Controller" from the object library to the design screen. After adding a Scene, you also need to connect it to the "Tab Bar Controller Scene" and press and hold the control key to drag the mouse from "Tab Bar Controller Scene" to "View Controller Scene ", then, release the mouse and select "view controllers" from the pop-up menu to complete the connection. Then we add a View Controller class "LiaoViewController ". Choose File> New> File... from the menu... In the file template, select iOS> Objective-C. The new file dialog box is displayed. In the Class project, enter "LiaoViewController", and select UIViewController in Subclass of. With XIB for user interface is not checked. Return to IB and select "View Controller Scene". Enable the ID checker and set "Custom Class> Class to" LiaoViewController ". Add the icon to the project, modify the icon and text in the Tab Bar, and select "Hei View Controller Scene"> "Hei View Controller"> "Tab Bar Item" to open the property checker, "Bar item?##title=is the zookeeper, And the image=is selected as javashei.png ". Modify the other two view controllers in the same way. For the design of the three views, refer to the nib implementation section of the previous article. Drag some Label controls, place the positions, modify the city name, and then modify the view background color. The tag navigation mode based on the story board is complete. We did not write a line of code throughout the process.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.