zoukankan      html  css  js  c++  java
  • iOS UI 01 课堂笔记 -设计模式

    主要是mvc 模式 

    但此处没有涉及到数据, 只是铺键视图和vc 掌握即可

    //

    //  RootViewController.m

    //  ui2 _设计模式

    //

    //  Created by dllo on 15/11/9.

    //  Copyright (c) 2015 dllo. All rights reserved.

    //


    #import "RootViewController.h"

    #import "LTFView.h"

    @interface RootViewController () <UIAlertViewDelegate>


    @end


    @implementation RootViewController


    - (void)viewDidLoad {

        [super viewDidLoad];

        self.view.backgroundColor = [UIColor blackColor];

        LTFView *view = [[LTFView alloc]initWithFrame:CGRectMake(50, 100, [UIScreen mainScreen].bounds.size.width - 50 * 2, 30)];

        view.label1.text = @"用户名";

        view.field1.placeholder = @"请输入用户名";

        LTFView *view1 = [[LTFView alloc]initWithFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y + view.frame.size.height + 30, view.frame.size.width, view.frame.size.height)];

        view1.label1.text = @"密码";

        view1.field1.placeholder = @"请输入密码";

        

        

        UIAlertView *q = [[[UIAlertView alloc]initWithTitle:@"提示" message:@"尊敬的用户" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"取消", nil] autorelease];

        [q show];

        

        q.delegate = self;

        [self.view addSubview:view];

        [self.view addSubview:view1];

        

        

        [view release];

        [view1 release];

        

        

        

        

        

        }

    - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex

    {

        NSLog(@"ni hao");

    }

    - (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



    //

    //  RootViewController.m

    //  ui2 _设计模式

    //

    //  Created by dllo on 15/11/9.

    //  Copyright (c) 2015 dllo. All rights reserved.

    //


    #import "RootViewController.h"

    #import "LTFView.h"

    @interface RootViewController () <UIAlertViewDelegate>


    @end


    @implementation RootViewController


    - (void)viewDidLoad {

        [super viewDidLoad];

        self.view.backgroundColor = [UIColor blackColor];

        LTFView *view = [[LTFView alloc]initWithFrame:CGRectMake(50, 100, [UIScreen mainScreen].bounds.size.width - 50 * 2, 30)];

        view.label1.text = @"用户名";

        view.field1.placeholder = @"请输入用户名";

        LTFView *view1 = [[LTFView alloc]initWithFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y + view.frame.size.height + 30, view.frame.size.width, view.frame.size.height)];

        view1.label1.text = @"密码";

        view1.field1.placeholder = @"请输入密码";

        

        

        UIAlertView *q = [[[UIAlertView alloc]initWithTitle:@"提示" message:@"尊敬的用户" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"取消", nil] autorelease];

        [q show];

        

        q.delegate = self;

        [self.view addSubview:view];

        [self.view addSubview:view1];

        

        

        [view release];

        [view1 release];

        

        

        

        

        

        }

    - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex

    {

        NSLog(@"ni hao");

    }

    - (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



  • 相关阅读:
    Jmeter运行原理
    hihoOffer收割练习20题目2
    hihoOffer收割练习20题目1
    STL-map容器
    STL-map容器
    2017多校合练1
    2017多校合练1
    STL之map基础知识
    STL之map基础知识
    DP入门
  • 原文地址:https://www.cnblogs.com/yuhaojishuboke/p/5043090.html
Copyright © 2011-2022 走看看