- (void)viewDidLoad
{
[super viewDidLoad];
UIView *view=[[UIView alloc]initWithFrame:CGRectMake(110,150,100, 100)];
view.backgroundColor=[UIColor clearColor];//填充色是透明的
view.layer.borderColor=[UIColor redColor].CGColor;//边框的颜色:红色
view.layer.borderWidth=0.5;//边框的尺寸:0.5.在2倍图下就是1像素
[self.view addSubview:view];
[view release];
}
显示效果如下: