program development

ios development_Common settings for UIButton

– (void)setTitle:(NSString *)title forState:(UICo […]

article directories

– (void)setTitle:(NSString *)title forState:(UIControlState)state;
Set the text of the button

– (void)setTitleColor:(UIColor *)color forState:(UIControlState)state;
Set the text color of the button

– (void)setImage:(UIImage *)image forState:(UIControlState)state;
Small picture inside the settings button

– (void)setBackgroundImage:(UIImage *)image forState:(UIControlState)state;
Background picture of the settings button
Set the text font of the button (you need to get the label inside the button to set it)
btn.titleLabel.font = [UIFont systemFontOfSize:13];

– (NSString *)titleForState:(UIControlState)state;
Get the text of the button

– (UIColor *)titleColorForState:(UIControlState)state;
Get the text color of the button

– (UIImage *)imageForState:(UIControlState)state;
Get a small picture inside the button

– (UIImage *)backgroundImageForState:(UIControlState)state;
Get the background image of the button