ios 方法使用

时间:2014-07-01 20:09:47   收藏:0   阅读:207

注意导入头文件

类方法的使用

//文件名 UIColor+Expend.h   扩展方法
.h @interface UIColor (Expend) .m // UIColor+Expend.m #import "UIColor+Expend.h" #pragma mark - 颜色转换 IOS中十六进制的颜色转换为UIColor + (UIColor *) colorWithHexString: (NSString *)color

使用

self.view.backgroundColor=[UIColor  colorWithHexString:@"#EEE4D9"];

---------------------------------------------------

继承方法

//.h 文件
@interface UnderlineButton : UIButton
+ (UnderlineButton *) underlinedButton;

直接使用

  UnderlineButton   *lginBtn=[UnderlineButton  buttonWithType:UIButtonTypeCustom];

  

 

 

ios 方法使用,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!