1 1>UIButton Internal Default has a Uiimageview, Uilabel control, can be accessed by the following properties:2@property (Nonatomic,ReadOnly, retain) Uiimageview *ImageView;3@property (Nonatomic,ReadOnly, retain) UILabel *Titlelabel;4 5 2>UIButton's ability to display text is entirely due to its internal Titlelabel6 that is, UIButton's settitle:forstate: The string that the method sets is displayed on the Titlelabel7 8 3>UIButton's setimage:forstate: The image of the method setting is displayed on the internal ImageView9 Ten 4>Note One*To set the text or text color of a button, you must use the following method A- (void) Settitle: (NSString *) title forstate: (uicontrolstate) state; -- (void) Settitlecolor: (Uicolor *) Color forstate: (uicontrolstate) state; - #warnning can not directly get Titlelabel set text and text color, such as the following procedure is wrong: theButton.titleLabel.text =@"12323"; -Button.titleLabel.textColor =[Uicolor Redcolor]; - -*To set a small image inside a button, you must use the following method +- (void) SetImage: (UIImage *) Image forstate: (uicontrolstate) state; - #warnning can not directly get ImageView to set up the picture, such as the following procedure is wrong: +Button.imageView.image = [UIImage imagenamed:@"Abc.png"];
iOS about UIButton internal structure