ios-use of the Navigation view controller

Source: Internet
Author: User

Summary

This chapter is mainly modified on the basis of the previous chapter, change it to the example of the navigation controller, the other changes are not very

Run Results


Process Overview

    1. Create a new base view-based program, and then change the project based on the navigation controller by opening main.storyboary, selecting Viewctroller, and then eeditor->ebed In->nav in Xcode: To achieve the conversion
    2. To create a new class for level two pages, this example uses a Level two Page object, using the title and page background color as a distinction
    3. Slightly

Main code

#pragma uitableviewdelegate-(void) TableView: (UITableView *) TableView Didselectrowatindexpath: (Nsindexpath *) indexpath{    //Modify Sub-page information    nsstring* cityname = [[Self._dictprovince objectforkey:[self._arraykeys Objectatindex : Indexpath.section]] objectAtIndex:indexPath.row];    Self._cityview.title = CityName;    Self._cityview.view.backgroundcolor = [Uicolor colorwithred:arc4random ()%100/100.0f green:arc4random ()%100/100.0f Blue:arc4random ()%100/100.0f alpha:1.0f];        Navigate to the next Level page    [Self.navigationcontroller pushviewcontroller:self._cityview animated:yes];}


Engineering Code


ios-use of the Navigation view controller

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.