`
gekie
  • 浏览: 155318 次
  • 性别: Icon_minigender_1
  • 来自: 海口
社区版块
存档分类
最新评论

为UIView及其子类添加圆角边框

 
阅读更多

1.添加QuartzCore.framework

2.实现代码

 

UIView *bfPanel = [[UIView alloc]initWithFrame:CGRectMake(x, y, width, height)];
bfPanel.layer.masksToBounds = YES;
bfPanel.layer.borderWidth  =1;
bfPanel.layer.cornerRadius = 10;
bfPanel.layer.borderColor= [[UIColor colorWithRed:0.52 green:0.09 blue:0.07 alpha:1] CGColor];
[mainView addSubview:bfPanel];
y +=height+10;
 

 

分享到:
评论
1 楼 hhb19900618 2011-11-12  
很好,很强大 呵呵

相关推荐

Global site tag (gtag.js) - Google Analytics