label:
UILabel *label = [[UILabel alloc] init];
label.en_alignment(NSTextAlignmentCenter).en_color([UIColor redColor]);
label.en_text(@"1233123").en_font([UIFont systemFontOfSize:11]);
//或者en_font(@11)
button:
//初始化直接完成按钮点击事件
UIButton *button = [[UIButton alloc] initWithCallBackButtonClickBlock:^(UIButton *button) {
NSLog(@"点击了按钮");
}];
button.en_bgColor([UIColor redColor]).en_normalTitleColor([UIColor blackColor]);
button.en_font(@11).en_highLightTitle(@"被点击").en_normalTitle(@"链式按钮");
//设置frame
button.en_frame(10,10,10,10);
新增了快速初始化控件的方法:
//UIView *view = self.instanceInit(TypeView);
UIView *view = UIView.classInit(TypeView);
详情请看demo
-
Notifications
You must be signed in to change notification settings - Fork 0
TPQuietBro/TPFastSettingForLabelAndButton
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
快速设置label和button的属性,根据思路可以扩展到更多系统控件,简单方便
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published