首页 > 技术文章 > 自定义按钮

dqxu 2014-10-11 09:28 原文

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

swift 自定义TextField 的边框颜色和 左右 视图

修改UIImage的大小

 

修改UIImage大小   iOS

 

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

 

推荐阅读