用ios代码做view

时间:2014-07-10 15:48:47   收藏:0   阅读:263

import“ViewController.h"

@interface ViewController()

@end

@implementation ViewController

-(void)viewDidload

{

[super viewDidload];

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

redview.frame=CGRectMake(0,0,300,100);

redview.backgroundcolor=[UIColor redColor];

[self.view addSubview:redview];

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

greenview.frame=CGRectMake(0,100,150,100);

greenview.backgroundColor=[UIColor greenColor];

[redview addSubview:greenview];

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

whiteview.frame=CGRectMake(150,100,150,100);

whiteview.backgroundColor=[UIColor blackColor];

[self.view addSubview:whiteview];

}bubuko.com,布布扣

用ios代码做view,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!