zoukankan      html  css  js  c++  java
  • UINavigationController

    1.使用的类 UINavigationController
    2.UINavigationController有两个重要的方法
       1)- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated;   (通过导航控制器跳到下一个页面)
        2)- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated;
           (通过导航控制器返回上一个页面)
    3.初始化一个导航控制器  设置导航控制器的第一个页面
          UINavigationController *nv = [[UINavigationController alloc]initWithRootViewController:viewController];
         把nv当做根视图控制器
      self.window.rootViewController = nv;
    
    4.title设置导航栏的标题 如:设置标题为主页
       self.title = @“主页”;
    5.在跳转页面后 如果跳到的这个页面没有设置背景颜色 就会出现 push卡顿的现象
    
    
    自己书写扩展栏上的按钮
    1.扩展栏上的按钮
      UIBarButtonItem *left = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(back)]; 
    2.tintColor 设置BarButtonItemd颜色
         ,left.tintColor = [UIColor blueColor];
    3.设置导航栏上面的内容  设置内容里面 左侧按钮的属性
        self.navigationItem.leftBarButtonItem = left;
      
    
  • 相关阅读:
    OI算法复习汇总
    B. Anatoly and Cockroaches
    c# 文件过大时清空原有内容重新写入
    c# 记录内容到txt文件
    c# 关闭和重启.exe程序
    mutex 互斥量
    mysql 事件
    <asp:Button点击查询后,调用js中函数展现加载圈
    取得<asp:TextBox中的值:
    json 相关知识
  • 原文地址:https://www.cnblogs.com/liYongJun0526/p/4881297.html
Copyright © 2011-2022 走看看