**
Set content distance from BTN border
**/
Btn.contentedgeinsets = uiedgeinsetsmake (0, 0, 0, 0);
/** label and ImageView as a whole
For example, placing the ImageView behind a label requires calculating the position of the ImageView relative to the label and the distance from the other side.
Popularly said by default the ImageView in the left Titlelabel on the right
Imageedgeinsets left Contrast position no button to border right contrast with his next label
Titlelabeledgeinsets is the same as image
The following code swaps image and label for left and right
**/
[Btn Setimageedgeinsets:uiedgeinsetsmake (0,btn.titlelabel.frame.size.width, 0,- Btn.titlelabel.frame.size.width-btn.imageview.frame.size.width)];
[Btn settitleedgeinsets:uiedgeinsetsmake (0, 0, 0,cgrectgetwidth (btn.imageView.frame))];
This method is more cumbersome to calculate than to directly customize the button to override the Layoutsubviews method directly set the image lable frame to achieve the effect
NOTE: [Super Layoutsubviews]
/**
Reversestitleshadowwhenhighlighted to set whether the shadow is highlighted when the caption is highlighted
Adjustsimagewhenhighlighted the default is yes. If so, when the image is highlighted (pressed)
Adjustsimagewhendisabled the default is yes. If yes, disabled when image is disabled
Showstouchwhenhighlighted is not by default. If yes, displays a simple feedback (currently a glow), while highlighting
**/
btn.reversestitleshadowwhenhighlighted = NO;
btn.showstouchwhenhighlighted = YES;
Set Shadow Color
[btn Settitleshadowcolor:[uicolor Redcolor] forstate:uicontrolstatenormal];
[btn Settitleshadowcolor:[uicolor Greencolor] forstate:uicontrolstatehighlighted];
Attributedstring Header Settings
Nsmutabledictionary * dic = [[Nsmutabledictionary alloc]init];
[dic Setobject:[uicolor Redcolor] forkey:nsbackgroundcolorattributename];
nsattributedstring * aStr = [[nsattributedstring alloc]initwithstring:@ "33333" attributes:dic];
[Btn Setattributedtitle:astr Forstate:uicontrolstatenormal];
/**
Gets the property value for the corresponding state
-(Nullable Uicolor *) Titlecolorforstate: (uicontrolstate) state
-(Nullable Uicolor *) Titleshadowcolorforstate: (uicontrolstate) state
-(Nullable UIImage *) Imageforstate: (uicontrolstate) state
-(Nullable UIImage *) Backgroundimageforstate: (uicontrolstate) state
-(Nullable nsattributedstring *) Attributedtitleforstate: (uicontrolstate) state
**/
/*
In subclasses you can overload the following methods, which return the CGRect structure, indicating the bounds of each component of the button.
Note: Do not call these methods directly, these methods are what you write to the system call.
-(CGRect) Backgroundrectforbounds: (cgrect) bounds set background border
-(CGRect) Contentrectforbounds: (cgrect) bounds developing content boundaries
-(CGRect) Titlerectforcontentrect: (cgrect) contentrect text title border
-(CGRect) Imagerectforcontentrect: (cgrect) contentrect Button Image border
*/
UIButton Internal Introduction