新建一个Button继承 UIButton
#pragma mark 调整内部UILabel的frame
- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
CGFloat imageX = contentRect.size.height * 1/6;
CGFloat imageY = contentRect.size.height * 1/6;
CGFloat imageHeight = (contentRect.size.height) * 2/3;
CGFloat imageWidth = imageHeight;
return CGRectMake(imageX, imageY, imageWidth, imageHeight);
}
- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
CGFloat titleX = contentRect.size.width - contentRect.size.height;
CGFloat titleHeight = contentRect.size.height;
CGFloat titleY = 0;
CGFloat titleWidth = contentRect.size.width - contentRect.size.height;
return CGRectMake(titleX, titleY, titleWidth, titleHeight);
}