Cap

square = [UIImage imageNamed:@"camera_face_noraml"] ;
  CGFloat top = square.size.height*0.3; // 顶端盖高度
  CGFloat bottom = square.size.height*0.3 ; // 底端盖高度
  CGFloat left = square.size.width*0.3; // 左端盖宽度
  CGFloat right = square.size.width*0.3; // 右端盖宽度
  UIEdgeInsets insets = UIEdgeInsetsMake(top, left, bottom, right);
  square = [square resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeStretch];

你可能感兴趣的:(Cap)