123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- //
- // UI_Formatter&Function.h
- // LN_School
- //
- // Created by apple on 2017/4/5.
- // Copyright © 2017年 Danson. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import <UIKit/UIKit.h>
- @interface UI_Formatter_Function : NSObject
- @end
- #pragma mark uifont
- @interface UIFont (ex)
- +(id)scaleSize:(CGFloat)font;
- @end
- #pragma mark NSNumber 转字符串
- @interface NSNumber (formatter)
- + (NSString *)stringValue;
- @end
- #pragma mark uiview
- @interface UIView (formatter)
- @property (nonatomic, assign) CGFloat x;
- @property (nonatomic, assign) CGFloat y;
- @property (nonatomic, assign) CGFloat centerX;
- @property (nonatomic, assign) CGFloat centerY;
- @property (nonatomic, assign) CGFloat width;
- @property (nonatomic, assign) CGFloat height;
- @end
- #pragma mark - uiimageView
- @interface UIImageView(formatter)
- /**等比缩小 适应imgV大小 裁剪超出部分
- */
- - (void)setModeAspectFill;
- @end
- #pragma mark - uiimage
- @interface UIImage(formatter)
- - (UIImage*)scaledToWid:(CGFloat)wid;
- - (UIImage*)originImageScaleToSize:(CGSize)size;
- - (UIImage*)tint:(UIColor*)color;
- /**生成新尺寸 不裁剪图片
- */
- - (UIImage *)scaledToSize:(CGSize)newSize;
- /**生成新尺寸 裁剪图片
- */
- - (UIImage *)scaledAndCutToSize:(CGSize)newSize;
- @end
- #pragma mark - lable
- @interface UILabel(formatter)
- -(void)setFont:(CGFloat)font TextColor:(UIColor*)color;
- -(void)setText:(NSString*)text Font:(CGFloat)font TextColor:(UIColor*)color;
- -(void)setText:(NSString*)text Font:(CGFloat)font TextColor:(UIColor*)color Alignment:(NSTextAlignment)align;
- @end
|