-(UIButton*)initWithFrame:(CGRect)frame
Title:(NSString*)text NormalImage:(UIImage*)normalImage
SelectedImage:(UIImage*)selectedImage{BaseButton*createButton = [UIButtonbuttonWithType:UIButtonTypeCustom];
createButton.frame= frame;
[createButtonsetImage:normalImageforState:UIControlStateNormal];
[createButtonsetImage:selectedImageforState:UIControlStateSelected];
createButton.imageEdgeInsets=UIEdgeInsetsMake(0,14,11,0);//设置image在button上的位置(上top,左left,下bottom,右right)这里可以写负值,对上写-5,那么image就象上移动5个像素[createButtonsetTitle:textforState:UIControlStateNormal];
createButton.titleLabel.font=
[UIFontsystemFontOfSize:12];
createButton.titleLabel.textAlignment=NSTextAlignmentCenter;//设置title的字体居中[createButtonsetTitleColor:[UIColorwhiteColor]forState:UIControlStateNormal];
[createButtonsetTitleColor:[UIColorblueColor]forState:UIControlStateSelected];//[createButton setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted];createButton.titleEdgeInsets=UIEdgeInsetsMake(26,
-14,0,0);returncreateButton;
}