Set view's corner with one code!
- 1 行代码设置圆角
Latest release version:
pod "JHViewCorner"
// corner
[_imageView jh_setCornerRadius:H*0.5
color:self.superview.backgroundColor
rectCorner:UIRectCornerAllCorners
highlightedColor:nil];
// corner and border
[_imageView jh_setCornerRadius:H*0.5
color:self.superview.backgroundColor
rectCorner:UIRectCornerAllCorners
borderColor:borderColor
borderWidth:width
highlightedColor:nil];
// heart
[_imageView jh_setHeartMask:color
highlightedColor:highlightedColor];
// heart and border
[_imageView jh_setHeartMask:color
borderColor:borderColor
borderWidth:width
highlightedColor:highlightedColor];
- fix a small bugs.
- add property 'jh_maskViewArray'.
- remove property 'jh_heartBorderMaskView'.
- add heart border mask.
- add heart mask.
- update.
- upload.
If you use it in "UITableViewCell"
you should override the blow methods:
// you have a image like this:
[_image1 jh_setCornerRadius:H*0.5
color:self.contentView.backgroundColor
rectCorner:UIRectCornerAllCorners
highlightedColor:UIColorFromRGB(0xd9d9d9)];
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
_image1.jh_highlightedMaskView.hidden = !selected;
}
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{
[super setHighlighted:highlighted animated:animated];
_image1.jh_highlightedMaskView.hidden = !highlighted;
}
Not Good!🤔
Not Good!🤔
Not Good!🤔
Good!👍👍👍