博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
iphone xcode4.3教程 key:xcode4.3
阅读量:7217 次
发布时间:2019-06-29

本文共 1636 字,大约阅读时间需要 5 分钟。

 1:原文摘自:

 

s :

在 Subclass of 可以填写要继承的对象

 with xib for user interface  是否建立绑定的xib 文件 一般绑定 storyboard 里的view 是不用打勾的   绑定Storyboard 上 ViewController 上章有说

   自定义控件 一般可以选上   方便布局

下面是ios 里面最常用的 Navigation Controller 的使用哦!

继续截图

直接拖个Navigation Controller 进来   选中 navigation controller 把 is initial view controller  打勾  这样这个view controller 成为我们的第一个界面

接着 可以删掉 root view controller  换成我们自己的view controller    从 navigation controller 拉线到我们的view controller 上  选relationship -xxxxxx  这样这个view controller

就成功navigation controller 的根界面了

再拉两个页面出来演示     上章有说 可以从 button 直接拉线  也可 从 view controller 拉线   从view controller 拉线的 记得把 identifier 写上  

style 选 push

建3个 viewcontrooler 并绑定

标题可以点击 Navigation item  设置 title 等一些属性  也可以在代码中设置

 

- (void)viewDidLoad

{

    [superviewDidLoad];

    self.title = @"地球";

   self.navigationItem.prompt =@"我是谁!";

}

其他两个viewController 标题

- (void)viewDidLoad

{

    [superviewDidLoad];

// Do any additional setup after loading the view.

    self.title = @"月亮";

}

- (void)viewDidLoad

{

    [superviewDidLoad];

// Do any additional setup after loading the view.

    self.title = @"火星";

}

在 再 button 事件里面写

 

- (IBAction)bt_pressed:(UIButton *)sender {

    

    [selfperformSegueWithIdentifier:@"GotoTwo"sender:self];

}

 运行下看看效果咯!

最后是一些跳转和返回的方法

 

 //根据 segue Identifier 跳转界面

    [self performSegueWithIdentifier:@"GotoTwo" sender:self];

    

    //modal 方式跳转

    [self presentModalViewController:nil animated:YES];

    

    //压进一个viewcontroller

    [self.navigationController pushViewController:nil animated:YES];

    //弹出一个viewcontroller  相当与返回上一个界面

    [self.navigationController popViewControllerAnimated:YES];

    

    //  modal跳转 的返回方法

    [self dismissModalViewControllerAnimated:YES];

 

转载于:https://www.cnblogs.com/85538649/archive/2012/06/12/2545978.html

你可能感兴趣的文章
js form表单 鼠标移入弹出提示功能
查看>>
LFS7.10——准备Host系统
查看>>
Redis.py客户端的命令总结【三】
查看>>
mac 安装secureCRT
查看>>
/var/adm/wtmp文件太大该怎么办?
查看>>
反应器模式 vs 观察者模式
查看>>
Algernon's Noxious Emissions POJ1121 zoj1052
查看>>
iOS-数据持久化-对象归档
查看>>
iOS开发UI篇—程序启动原理和UIApplication
查看>>
MUI 里js动态添加数字输入框后,增加、减少按钮无效
查看>>
python pip 更换国内安装源(windows)
查看>>
结对编程2后篇
查看>>
oracle exp 和 imp 数据和表结构互相独立导出导入
查看>>
iphone-common-codes-ccteam源代码 CCNSPredicate.m
查看>>
这次项目中应该注意的问题和应该保持的好习惯
查看>>
python-数据结构化与保存
查看>>
LeetCode - 551. Student Attendance Record I
查看>>
Java用户线程和守护线程
查看>>
ClassLoader类加载机制&&JVM内存管理
查看>>
Caml语句 查询分配给当前用户及当前组
查看>>