【代码笔记】给UIImageView加上圆角效果
2016-03-11 09:42
411 查看
一,效果图。
![](http://images2015.cnblogs.com/blog/337518/201510/337518-20151019115233208-37766943.jpg)
二,代码。
RootViewController.m
![](http://images2015.cnblogs.com/blog/337518/201510/337518-20151019115233208-37766943.jpg)
二,代码。
RootViewController.m
#import "RootViewController.h" @interface RootViewController () @end @implementation RootViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. //圆角效果 [self addView]; } #pragma -mark -functions //圆角效果 -(void)addView { UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(50, 100, 200, 200)]; imageView.backgroundColor=[UIColor greenColor]; imageView.layer.cornerRadius = 10; imageView.clipsToBounds = YES; [self.view addSubview:imageView]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. }
相关文章推荐
- 【代码笔记】给UIImageView加上圆角效果
- 扩展对EasyUI的校验规则
- STL之priority_queue
- xcodebuild命令行编译错误问题解决
- 给easyui datebox扩展一个清空按钮
- codeforces 245H . Queries for Number of Palindromes 区间dp
- iOS App中UITableView左滑出现删除按钮及其cell的重用
- UI--基础控件
- Rvalue Reference In Cxx11
- struct和nuion、类的补齐规则,以及sizeof求大小
- 设置UITextField的placeholder的颜色及字体
- IOS学习 UITableView 索引 涉及数组排序
- MySQLdb TypeError: %d format: a number is required
- Truncated incorrect DOUBLE value
- iOS UITextView控件方法简介
- 字符串:StringBuilder()
- Java——GUI
- Java String StringBuilder 和 StringBuffer 用法详解
- 从Request中获得当前请求的全路径
- 从Request获取Ip