码迷,mamicode.com
首页 > 移动开发 > 详细

用ios代码做view

时间:2014-07-10 15:48:47      阅读:263      评论:0      收藏:0      [点我收藏+]

标签:blog   http   color   os   2014   io   

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

用ios代码做view

标签:blog   http   color   os   2014   io   

原文地址:http://www.cnblogs.com/sunxiang1991/p/3834997.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!