ios 方法使用

注意导入头文件

类方法的使用

//文件名 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];

  

 

 

posted @ 2014-06-30 17:16  huluo666  阅读(145)  评论(0编辑  收藏  举报