UIImageView 详解

1、//设置 圆角  
userhead.layer.masksToBounds = YES;  
userhead.layer.cornerRadius = 6.0;  
userhead.layer.borderWidth = 1.0;  
userhead.layer.borderColor = [[UIColor whiteColor] CGColor];  

userhead可以是一个UIImageView,也可以是UIView
对了,记得
#import <QuartzCore/QuartzCore.h>

没有这个库的麻烦在framework里面导入

参考:http://www.cnblogs.com/imzzk/archive/2012/04/28/addroundedcornerstouiimageview.html

2、经验:UIImageView 如果作为其它有事件响应控件的superView时,这个控件的响应事件会失效!如果希望其能够响应点击事件,请设置如下属性:
view.userInteractionEnabled = YES;





posted @ 2014-04-13 19:46  ygm900  阅读(645)  评论(0)    收藏  举报