Skip to content

在项目中经常遇到要根据用户交互改变UIlabel,UIbutton,UIview的背景色,边框颜色,字体颜色的情况UIView+MixColor就是用Runtime实现根据视图状态改变各种颜色属性的分类

Notifications You must be signed in to change notification settings

Yamyee/UIView-MixColor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

UIView-MixColor

运行时绑定属性的一个小分类,可以设定UIView子类两种状态的边框颜色,背景色,UIButton,UILabel的文字颜色

默认边框宽度1.0

self.button.normalBorderColor = [UIColor grayColor];

self.button.selectBorderColor = [UIColor blueColor];

self.button.normalTextColor = [UIColor lightGrayColor];

self.button.selectTextColor = [UIColor cyanColor];

self.button.normalBackColor = [UIColor whiteColor];

self.button.selectBackColor = [UIColor grayColor];

  • (IBAction)onButtonClick:(UIButton *)sender {

    sender.mixSelected = !sender.mixSelected; }

About

在项目中经常遇到要根据用户交互改变UIlabel,UIbutton,UIview的背景色,边框颜色,字体颜色的情况UIView+MixColor就是用Runtime实现根据视图状态改变各种颜色属性的分类

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published