ios纯代码NavigationController跳转页面
来源:互联网 发布:如何获取扫描枪的数据 编辑:程序博客网 时间:2024/05/22 07:50
1、米有xib,storyboard,只有.h和.m文件
2、在AppDelegate中,要跳转页面,需要初始化当前ViewController的NavigationController
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
//一下三步,为了去掉storyboard;点击项目,将main interface值置为空
//设置全屏
self.window = [[UIWindowalloc]initWithFrame:[UIScreenmainScreen].bounds];
/**将自己的默认启动ViewController设为根视图**/
//app入口Viewcontroller
ViewController * vc =[[ViewControlleralloc]init];
UINavigationController * nav =[[UINavigationControlleralloc] initWithRootViewController:vc];
self.window.rootViewController = nav;
//显示
[self.windowmakeKeyAndVisible];
returnYES;
}
3、初始化UIButton:
UIButton *mBtn = [UIButtonbuttonWithType:UIButtonTypeRoundedRect];
[mBtn setFrame:CGRectMake(50,50, 100,100)];
[mBtn setTitle:@"页面跳转" forState:UIControlStateNormal];
[mBtn addTarget:selfaction:@selector(onClick:)forControlEvents:UIControlEventTouchUpInside];
[self.viewaddSubview:mBtn];
4、监听
-(void)onClick:(UIButton *)a
{
NSLog(@"touch down");
DrawViewController *vController = [[DrawViewController alloc] init];
[self.navigationController pushViewController:vController animated:true];
}
- ios纯代码NavigationController跳转页面
- iOS 纯代码跳转
- IOS 页面跳转方法(采用Storyboard或者纯代码)
- navigationController跳转指定页面
- 【IOS学习】视图切换,纯代码实现 UITabBarController,NavigationController
- navigationController 实现自选页面跳转
- IOS页面布局 纯代码
- iOS 页面跳转,离开之前pop掉navigationController栈中的页面
- 不同navigationcontroller里的页面跳转
- Swift - 纯代码实现页面segue跳转,以及参数传递
- Swift - 纯代码实现页面segue跳转,以及参数传递
- ios navigationController导航跳转方式自定义
- iOS 代码跳转 openURL 打开系统页面
- iOS self.navigationController退出到指定页面
- 纯js页面跳转整理
- 纯js页面跳转整理
- iOS现成的引导页面的实现:纯代码
- ios 导航控制器(navigationController)代码方式创建
- Android activity-alias 多入口配置
- Simhash vs Minhash
- Qt学习之路(17): Qt标准对话框之QMessageBox
- 使用WakeLock使Android应用程序保持后台唤醒
- spring配置文件详解--真的蛮详细
- ios纯代码NavigationController跳转页面
- Android学习笔记(3)--烧录 & 系统映像文件
- 《APUE》 第一章 图1-7 程序代码中execlp()部分解析
- MQTT V3.1协议规范(明哥翻译)
- 未能加载文件或程序集“Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342"
- Android的Application
- XMPP协议实现原理介绍
- 18-org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProces
- scala学习笔记之 scala多重继承中的混入顺序和对象调用顺序说明