IOS uicontroller
来源:互联网 发布:ubuntu环境变量bashrc 编辑:程序博客网 时间:2024/05/22 05:09
#import "AppDelegate.h"#import "mainViewController.h"@interface AppDelegate () @end@implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor redColor]; mainViewController *mvc = [[mainViewController alloc]init]; self.window.rootViewController = mvc; [self.window makeKeyAndVisible]; return YES;}
#import "mainViewController.h"#import "subViewController.h"@interface mainViewController ()@end@implementation mainViewController- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self;}- (void)viewDidLoad{ [super viewDidLoad]; self.navigationController.transitionCoordinator ==NO; self.view.backgroundColor = [UIColor orangeColor]; NSLog(@"x = %f",self.view.frame.origin.x); NSLog(@"y = %f",self.view.frame.origin.y); NSLog(@"w = %f",self.view.frame.size.width); NSLog(@"h = %f",self.view.frame.size.height); UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; btn.frame = CGRectMake(10, 30, 300, 30); [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; btn.backgroundColor = [UIColor whiteColor]; [btn setTitle:@"模式对话窗体跳转" forState:UIControlStateNormal]; [btn addTarget:self action:@selector(btnclick) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:btn]; UITextView *textview = [[UITextView alloc]initWithFrame:CGRectMake(10, 70, 300, 50)]; textview.text = @"欢迎您"; textview.backgroundColor = [UIColor whiteColor]; textview.textColor = [UIColor blackColor]; [self.view addSubview:textview]; // Do any additional setup after loading the view.}-(void)btnclick{ subViewController *svc = [[subViewController alloc]init]; svc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentViewController:svc animated:YES completion:^{}];}- (void)didReceiveMemoryWarning{ [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}-(void)loadView{ [super loadView];}-(void)viewWillAppear:(BOOL)animated{}/*#pragma mark - Navigation// In a storyboard-based application, you will often want to do a little preparation before navigation- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller.}*/@end
#import "subViewController.h"#import "mainViewController.h"@interface subViewController ()@end@implementation subViewController- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self;}- (void)viewDidLoad{ [super viewDidLoad]; self.view.backgroundColor = [UIColor blueColor]; UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; btn.frame = CGRectMake(10, 30, 300, 30); [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; btn.backgroundColor = [UIColor whiteColor]; [btn setTitle:@"关闭对话窗体" forState:UIControlStateNormal]; [btn addTarget:self action:@selector(btnclick) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:btn]; // Do any additional setup after loading the view.}-(void)btnclick{ mainViewController *mvc = [[mainViewController alloc]init]; [self presentViewController:mvc animated:YES completion:^{}]; // [self dismissViewControllerAnimated:YES completion:^{ }];}- (void)didReceiveMemoryWarning{ [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}/*#pragma mark - Navigation// In a storyboard-based application, you will often want to do a little preparation before navigation- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller.}*/@end
0 0
- IOS uicontroller
- ios--UIController初识
- UIController
- IOS开发之UIController生命周期
- IOS开发之UIController生命周期
- IOS开发概述-09.UIController和控制器的View
- iOS开发 UI 加深理解UIView,UIResponder,UIController
- UIController 跳转
- IOS开发之UI设计---视图交互与事件(UIButton,UIImage,UIImageView,UIController)
- IOS--如何从第N级界面返回到一级界面(即添加在UITabbarController上的UIController)
- 加深理解UIView,UIResponder,UIController
- UI开发----UIController及其子类
- UIController子类控件 UI_06
- Interface Builder 和UIController的联系
- UIController中有多个UICollectionView可能会出现的问题
- 自定义一个View用UIcontroller去调用的时候
- UI课程06 UIController及其子类,已学所有类的关系
- iOS
- SQL Server用户自定义函数
- iOS应用崩溃(一)——Crash文件解析
- 简单的 C++ SOCKET编程 ---基于TCP/IP协议
- Ant-Ant命令行参考
- Android 实现登录注册功能
- IOS uicontroller
- Theme Section
- C++ Socket编程步骤
- Android selector标签
- 添加yum 源
- 一种高性能网络游戏服务器架构设计
- DNS相关概念
- 使用面向对象的方式模拟TOM使用ATM进行存取款的操作
- iOS应用崩溃(二)——符号化解析