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;




UIImageView 详解

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-03
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
猜你喜欢
  • 2021-06-02
  • 2022-12-23
  • 2022-02-19
  • 2021-04-01
  • 2022-01-12
  • 2022-12-23
  • 2022-01-18
相关资源
相似解决方案