新建一个UIButton 类 重写layoutSubviews方法
-(void)layoutSubviews
{
// Center image
[superlayoutSubviews]
CGPoint center =self.imageView.center
center.x =self.frame.size.width/2
center.y =self.imageView.frame.size.height/2+5
self.imageView.center = center
//Center text
CGRect newFrame = [selftitleLabel].frame
newFrame.origin.x =0
newFrame.origin.y =self.imageView.frame.size.height
newFrame.size.width =self.frame.size.width
self.titleLabel.frame = newFrame
self.titleLabel.textAlignment =NSTextAlignmentCenter
}