zoukankan      html  css  js  c++  java
  • UINavigationBar

    UINavigationBar

    UINavigationBar是一个负责View跳转的控件。在NavigationBar下面允许存在子View

    屏幕快照 2016 04 14 上午11 03 16


    有二种方式可以创建UINavigationBar


    1. 代码篇
    创建2个Controller,一个继承自ViewController

    项目右键->NewFile->Cocoa Touch Class。

    屏幕快照 2016 04 14 上午11 11 19

    Subclass of:选择ViewController,创建一个ViewController

     屏幕快照 2016 04 14 上午11 12 58


    同样的方式在创建一个Controller
    Subclass of:UINavigationController


    我们在项目代码的AppDelegate.m文件中加入如下代码:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

        // Override point for customization after application launch.

        //创建一个UIViewController

        UIViewController* vcontroller = [[UIViewControlleralloc]initWithNibName:nilbundle:nil];

        

        //创建一个NavigationController 包含一个viewController

        MyNavigationController* myncontroller = [[MyNavigationControlleralloc]initWithRootViewController:vcontroller];

        

        //window大小根据系统的硬件来

        self.window = [[UIWindowalloc]initWithFrame:[[UIScreenmainScreen] bounds]];

        

        self.window.rootViewController = myncontroller;

        

        self.window.backgroundColor = [UIColorredColor];

        

        [self.windowmakeKeyAndVisible];

     

        returnYES;

    }




  • 相关阅读:
    EF Load之详讲
    WPF系列 自定控件
    EF6 的性能优化
    WPF系列 Path表示语法详解(Path之Data属性语法)
    WPFTookit Chart 高级进阶
    WPFTookit Chart 入门
    WPF系列-CheckBox
    WPF系列 Style
    ASP.NET MVC 5 with EF 6 上传文件
    WPF Prism
  • 原文地址:https://www.cnblogs.com/kfsmqoo/p/5390362.html
Copyright © 2011-2022 走看看