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



  • 相关阅读:
    VS2013 快捷键乱掉如何修改回来
    WCF契约之---服务契约 、数据契约、 消息契约
    成功的背后!(给所有IT人)----转载:来自CSDN第一名博主
    C# Attribute(特性)之---契约---[ServiceContract] 、 [OperationContract]
    SQL Server数据库连接字符串整理
    大写String和小写string的区别
    C#经典之Application.DoEvents()的使用
    C#实现多态之一抽象
    C# Attribute(特性)之---数据契约 [DataContract]
    Druid数据库连接池获取连接阻塞(转载)
  • 原文地址:https://www.cnblogs.com/yuhaojishuboke/p/5043090.html
Copyright © 2011-2022 走看看