自定义按钮 swift 自定义TextField 的边框颜色和 左右 视图 修改UIImage的大小

- (CGRect)backgroundRectForBounds:(CGRect)bounds;        //返回背景边界 (image + title)
- (CGRect)contentRectForBounds:(CGRect)bounds;               //
- (CGRect)titleRectForContentRect:(CGRect)contentRect;      //返回title边界
- (CGRect)imageRectForContentRect:(CGRect)contentRect;  //返回image边界
 

修改UIImage的大小

修改UIImage大小   iOS

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