Lesson01-Homework UIView作业

39 篇文章 0 订阅
            登陆页面                                                    注册页面                                                            密码找回页面
                                                                     

登陆页面:
    //1.创建视图, 给出其位置和大小
    UIView *signinView = [[UIView alloc] initWithFrame:CGRectMake(80, 130, 235, 40)];
    
    //2.设置视图属性
    //颜色
    signinView.backgroundColor = [UIColor blueColor];
    signinView.alpha = 1;
    
    //3.添加到window上
    [self.window addSubview:signinView];
    
    //4.释放视图
    [signinView release];
    
    UIView *signinView1 = [[UIView alloc] initWithFrame:CGRectMake(80, 200, 90, 40)];
    signinView1.backgroundColor = [UIColor greenColor];
    signinView1.alpha = 1;
    [self.window addSubview:signinView1];
    [signinView1 release];
    
    UIView *signView2 = [[UIView alloc] initWithFrame:CGRectMake(225, 200, 90, 40)];
    signView2.backgroundColor = [UIColor greenColor];
    signView2.alpha = 1;
    [self.window addSubview:signView2];
    [signView2 release];

注册页面:
    CGFloat y = 90;

    for (NSInteger i = 0; i < 6; i++) {
        //六个红
        UIView *redView = [[UIView alloc] initWithFrame:CGRectMake(60, y + 70 * i, 51, 40)];
        redView.backgroundColor = [UIColor redColor];
        redView.alpha = 1;
        [self.window addSubview:redView];
        [redView release];
        //六个蓝
        UIView *blueView = [[UIView alloc] initWithFrame:CGRectMake(152, y + 70 * i, 163, 40)];
        blueView.backgroundColor = [UIColor blueColor];
        blueView.alpha = 1;
        [self.window addSubview:blueView];
        [blueView release];
    }
    
    CGFloat x = 60;
    
    for (NSInteger i = 0; i < 2; i++) {
        //两个黄
        UIView *yellowView = [[UIView alloc] initWithFrame:CGRectMake(x + 158 * i, 540, 97, 40)];
        yellowView.backgroundColor = [UIColor yellowColor];
        yellowView.alpha = 1;
        [self.window addSubview:yellowView];
        [yellowView release];
    }

密码找回页面:
    CGFloat y = 100;
    for (NSInteger i = 0; i < 2; i++) {
        UIView *redView = [[UIView alloc] initWithFrame:CGRectMake(60, y + 70 * i, 71, 40)];
        redView.backgroundColor = [UIColor redColor];
        redView.alpha = 1;
        [self.window addSubview:redView];
        [redView release];
        
        UIView *blueView = [[UIView alloc] initWithFrame:CGRectMake(161, y + 70 * i, 154, 40)];
        blueView.backgroundColor = [UIColor blueColor];
        blueView.alpha = 1;
        [self.window addSubview:blueView];
        [blueView release];
        
    }
    
    CGFloat x = 60;
    
    for (NSInteger i = 0; i < 3; i++) {
        UIView *greenView = [[UIView alloc] initWithFrame:CGRectMake(x + 96 * i,300, 63, 40)];
        greenView.backgroundColor = [UIColor greenColor];
        greenView.alpha = 1;
        [self.window addSubview:greenView];
        [greenView release];
    }



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值