category用法
来源:互联网 发布:淘宝旗舰店申请 编辑:程序博客网 时间:2024/06/06 03:38
//// UILabel+categoryTest.h// test//#import <UIKit/UIKit.h>@interface UILabel (categoryTest)// category用法+ (UILabel*)labelWithFrame:(CGRect)frmae text:(NSString *)text font:(NSInteger)font backgroundColor:(UIColor *)color;@end
//// UILabel+categoryTest.m// test//#import "UILabel+categoryTest.h"@implementation UILabel (categoryTest)+ (UILabel*)labelWithFrame:(CGRect)frmae text:(NSString *)text font:(NSInteger)font backgroundColor:(UIColor *)color{ UILabel * label = [[UILabel alloc] initWithFrame:frmae]; label.text = text; label.font = [UIFont systemFontOfSize:font]; label.backgroundColor = color; return label;}@end
//// ViewController.m// test//#import "ViewController.h"#import "UILabel+categoryTest.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; UILabel * lable = [UILabel labelWithFrame:CGRectMake(100, 100, 100, 30) text:@"text" font:12 backgroundColor:[UIColor redColor]]; [self.view addSubview:lable];}@end
阅读全文
0 0
- Category用法
- category用法
- Category的用法
- Category的用法
- Category的用法(类目)
- Category分类用法
- OC基础-Category的用法
- 三 category和enumeration的用法
- Objective-c中Category的用法
- Objective-C中的Category的用法
- Objective-c中Category的用法
- 15-Category的使用场景及用法
- android 中category、data、action用法
- self,super,protocol,category,extension 的用法
- Category
- Category
- Category
- category
- HTTP响应状态码
- 未能找到程序集“Microsoft.DirectX.DirectInput, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856a
- 利用python进行数据分析学习笔记-Numpy篇
- 关于微信扫码支付
- greenDAO的使用详解---(3)greenDAO3.2.2数据库的升级bug解决
- category用法
- golang使用sqlite
- Redux代理Type
- CefSharp 集成谷歌浏览器详解(二)--官网示例解析1启动
- mysql中对sql的调优方法
- php函数相关(3):函数体中局部变量改变全局变量
- org.hibernate.NonUniqueObjectException: A different object with the same identifier value was alread
- 欢迎使用CSDN-markdown编辑器
- package.json 文件