- (void)viewDidLoad {
[super viewDidLoad];
//点击按钮跳转
loginViewController *vc=[[loginViewController alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
[self presentViewController:nav animated:YES completion:nil];
}
@implementation loginViewController

- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"取消" style:UIBarButtonItemStyleDone target:self action:@selector(cancel)];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"注册" style:UIBarButtonItemStyleDone target:self action:@selector(regist)];
self.title = @"登陆";
}
//取消
- (void)cancel
{
[self dismissModalViewControllerAnimated:YES];
}
//注册
-(void)regist
{ }
@end

@implementation MJOneViewController
- (void)viewDidLoad
{
[super viewDidLoad]; self.navigationItem.title = @"第1个控制器"; // 修改下一个界面返回按钮的文字
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStyleDone target:nil action:nil];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:nil action:nil];
} - (IBAction)jumpTwo {
// 调到第2个控制器
MJTwoViewController *two = [[MJTwoViewController alloc] init];
//[self.navigationController presentModalViewController:two animated:YES];
[self.navigationController pushViewController:two animated:YES];
}
@end
@implementation MJTwoViewController

- (void)viewDidLoad
{
[super viewDidLoad]; self.navigationItem.titleView = [UIButton buttonWithType:UIButtonTypeContactAdd];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:nil action:nil];
self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc] initWithTitle:@"哈哈" style:UIBarButtonItemStyleDone target:self action:nil];
} - (IBAction)jumpThree {
MJThreeViewController *three = [[MJThreeViewController alloc] init];
[self.navigationController pushViewController:three animated:YES];
}
@end

ios中模态弹窗用法及UINavigationController基本用法的更多相关文章

  1. iOS中block的用法 以及和函数用法的区别

    ios中block的用法和函数的用法大致相同 但是block的用法的灵活性更高: 不带参数的block: void ^(MyBlock)() = ^{}; 调用的时候  MyBlock(); 带参数的 ...

  2. 【IOS】ios中NSUserDefault与android中的SharedPreference用法简单对比

    以下内容为原创,欢迎转载,转载请注明 来自天天博客:http://www.cnblogs.com/tiantianbyconan/p/3405308.html 有Android开发经验的朋友对Shar ...

  3. IOS中的UINavigationController(导航控制器)

    UINavigationController UINavigationControlle:导航控制器,是iOS中最常用的多视图控制器之一,它用来管理多个试图控制器 导航控制器可以认为是管理控制器的控制 ...

  4. 微信中使用popup等弹窗组件时点击输入框input键盘弹起导致IOS中按钮无效处理办法

    因为在IOS微信中在弹窗中使用input使键盘弹起,使弹窗的位置上移,当键盘关闭时页面还在上面,弹窗位移量也在上面,只有下拉才能回到原位,这样弹窗也消失了.我的处理办法就是在键盘弹起和消失的时候,让页 ...

  5. react-native自定义Modal模态框|仿ios、微信弹窗RN版

    前序 纵观每个优质项目,无论web端还是native原生应用开发,弹窗都是不可忽视的一环,能很大程度上直接决定用户体验.如:微信.支付宝.ios都有很成熟的一套弹窗UI展示场景. 最近一直沉迷在rea ...

  6. uni-app自定义Modal弹窗组件|仿ios、微信弹窗效果

    介绍 uniapp自定义弹窗组件uniPop,基于uni-app开发的自定义模态弹窗|msg信息框|alert对话框|confirm确认框|toast弱提示框 支持多种动画效果.多弹窗类型ios/an ...

  7. IOS中调用系统的电话、短信、邮件、浏览功能

    iOS开发系列--通讯录.蓝牙.内购.GameCenter.iCloud.Passbook系统服务开发汇总 2015-01-13 09:16 by KenshinCui, 26990 阅读, 35 评 ...

  8. iOS 中有用的开源库

    youtube下载神器:https://github.com/rg3/youtube-dl vim插件:https://github.com/Valloric/YouCompleteMe vim插件配 ...

  9. ios 中的小技巧 - 总有你想要的 一

    UITableView的Group样式下顶部空白处理 在viewWillAppear里面添加如下代码: //分组列表头部空白处理 CGRect frame = myTableView.tableHea ...

随机推荐

  1. (Review cs231n) ConvNet

    概念 神经网络的深度和数据据体的深度(图像的通道数channels)要主要区分. 输入 1.得到一些数据,作为网络的输入. 2.在CNN中有filter,the size of filter is s ...

  2. JS设计模式(2)策略模式

    什么是策略模式? 定义:根据不同参数可以命中不同的策略 主要解决:在有多种算法相似的情况下,使用 if...else 所带来的复杂和难以维护. 何时使用:有许多种情况,而区分它们的只是他们直接的行为. ...

  3. 在VS2013 使用C语言库函数,出现出现错误,提示使用不安全函数use _CRT_SECURE_NO_WARNINGS

    在VS 2013 中编译 C 语言项目,如果使用了 scanf 函数,编译时便会提示如下错误: error C4996: 'scanf': This function or variable may ...

  4. #python计算结果百位500向下取整,(0-499取000,500-999取500)

    !/usr/bin/env python coding:utf-8 计算结果百位500向下取整,(0-499取000,500-999取500) import math calc_Amount = fl ...

  5. java 保存到mysql数据库中文乱码

    <property name="jdbcUrl">jdbc:mysql://localhost:3306/company?useUnicode=true&cha ...

  6. 表达式引擎aviator

    Aviator是一个轻量级.高性能的Java表达式执行引擎, 本文内容主要来自于官方文档 简介 包依赖 使用手册 执行表达式 使用变量 exec 方法 调用函数 自定义函数 编译表达式 访问数组和集合 ...

  7. ssm+redis整合(通过cache方式)

    这几天的研究ssm redis 终于进入主题了,今天参考了网上一些文章搭建了一下ssm+redis整合,特别记录下来以便以后可以查询使用,有什么不足请大牛们提点 项目架构 1.pom.xml < ...

  8. JVM(二)之GC(转)

    一.为什么需要垃圾回收 如果不进行垃圾回收,内存迟早都会被消耗空,因为我们在不断的分配内存空间而不进行回收.除非内存无限大,我们可以任性的分配而不回收,但是事实并非如此.所以,垃圾回收是必须的. 二. ...

  9. EF Core

    一个事务中    先在数据库查出一条数据进行修改      然后在进行查询  他会直接在内存中找到这条数据  不会再数据库查询了 EF Core的 linq语句中可以使用C#方法或函数   在EF6或 ...

  10. js自己总结的小东西(打印出来方便学习)

    1.你对angular有哪些认识? 属于mvvm框架,现在非常的火,由谷歌开发出来并维护的框架,为了解决负责业务中ajax的开发痛苦,刚开始结果angular的时候,确实让我有一种耳目一些,原来代码还 ...