天天看點

RDMBorderedButton

rdmborderedbutton

RDMBorderedButton

https://github.com/reesemclean/rdmborderedbutton

效果:

RDMBorderedButton

源碼:

rdmborderedbutton.h + rdmborderedbutton.m

顯示的代碼:

附錄:

usage

in code: use initwithframe to create a button and add to a subview.

corner radius

by default, rdmborderedbutton will adjusts the corner radius of its border based on its frame. you can turn this off with:

you can also change the ratio of the corner radius of this automatic adjustment:

note that changes to corner radius will not be animated. if you would like a corner radius change to be animated you will need to animate the key path using coreanimation. see the programatic view controller in the example project to see an example of this.

the corner radius can be adjusted manually (this turns off automatic adjustments):

the text and border color are adjusted together. for normal state they can be changed using either:

or:

disabled state can be adjusted using:

the text color when highlighted should be changed using: