• 李冬强-用代码写view


    主要代码

    //

    //  ViewController.m

    //  创建view-709

    //

    //  Created by apple on 14-7-9.

    //  Copyright (c) 2014年 戴维营教育. All rights reserved.

    //

    #import "ViewController.h"

    @interface ViewController ()

                

    @end

    @implementation ViewController

                

    - (void)viewDidLoad {

        [super viewDidLoad];

        // Do any additional setup after loading the view, typically from a nib.

    //    CGPoint origin={0,0};

    //    CGSize size={50,50};

    //    CGRect rect={origin,size};

        

        UIView *yellView=[[UIView alloc]init];

        yellView.frame=CGRectMake(0, 0, 200, 200);

        yellView.backgroundColor=[UIColor yellowColor];

        [self.view addSubview:yellView];

        

        

        UIView *whiteView=[[UIView alloc]init];

        whiteView.frame=CGRectMake(0, 0, 100, 100);

        whiteView.backgroundColor=[UIColor grayColor];

        [yellView addSubview:whiteView];

        

        UIView *redView=[[UIView alloc]init];

        redView.frame=CGRectMake(100, 100, 100, 100);

        redView.backgroundColor=[UIColor redColor];

        [self.view addSubview:redView];

    }

    - (void)didReceiveMemoryWarning {

        [super didReceiveMemoryWarning];

        // Dispose of any resources that can be recreated.

    }

    @end

  • 相关阅读:
    键盘过滤驱动
    多线程和多进程的差别(小结)
    Android UI设计规则
    怎样使用SetTimer MFC 够具体
    Chord算法(原理)
    POJ 1384 Piggy-Bank 背包DP
    Bulk Insert命令具体
    hibernate官方新手教程 (转载)
    教你用笔记本破解无线路由器password
    转换流--OutputStreamWriter类与InputStreamReader类
  • 原文地址:https://www.cnblogs.com/lidongq/p/3834202.html
Copyright © 2020-2023  润新知