// // FZYControl.h // // Created by 范智渊 on 2016/8/27. // Copyright © 2018年 范智渊. All rights reserved. // #import @interface FZYControl : NSObject #pragma mark --创建Label +(UILabel*)createLabelWithFrame:(CGRect)frame Font:(UIFont *)font Text:(NSString*)text; + (UILabel *)createLabelWithFrame:(CGRect)frame Font:(UIFont *)font Text:(NSString *)text color:(UIColor *)color; ///更新方法 9月17号新增 修改font 传入类型 + (UILabel *)createLabelWithframe:(CGRect)frame Font:(UIFont *)font Text:(NSString *)text color:(UIColor *)color; +(UILabel*)createLabelWithFrame:(CGRect)frame Font:(UIFont*)font Text:(NSString*)text color:(UIColor*)color textAlignment:(NSTextAlignment)alignment; +(UILabel*)createLabelWithFrame:(CGRect)frame Font:(UIFont*)font Text:(NSString*)text color:(UIColor*)color textAlignment:(NSTextAlignment)alignment backgroundColor:(UIColor *)backgroundColor; +(UILabel *)createLabelWithFrame:(CGRect)frame Font:(UIFont *)font Text:(NSString *)text color:(UIColor *)color textAlignment:(NSTextAlignment)alignment numberOfLines:(NSInteger)numberOfLines tag:(NSInteger)tag; #pragma mark --创建View +(UIView*)viewWithFrame:(CGRect)frame; +(UIView*)viewWithFrame:(CGRect)frame backgroundColor:(UIColor *)color; +(UIView*)viewWithFrame:(CGRect)frame backgroundColor:(UIColor *)color borderColor:(CGColorRef )borderColor borderWidth:(CGFloat)borderWidth ; +(UIView*)viewWithFrame:(CGRect)frame backgroundColor:(UIColor *)color viewTagValue:(NSInteger)tag; #pragma mark --创建imageView +(UIImageView*)createImageViewWithFrame:(CGRect)frame ImageName:(NSString*)imageName; +(UIImageView*)createImageViewWithFrame:(CGRect)frame ImageName:(NSString*)imageName contentMode:(UIViewContentMode)contentMode; +(UIImageView*)createImageViewWithFrame:(CGRect)frame ImageName:(NSString*)imageName imageTagValue:(NSInteger)tag; #pragma mark --创建button /** imageName selected action title selectedTitle titleColor selectedColor font backgroudColor*/ +(UIButton*)createButtonWithFrame:(CGRect)frame ImageName:(NSString*)imageName selectedImage:(NSString *)selected Title:(NSString*)title selectedTitle:(NSString *)selectedTitle titleColor:(UIColor *)color selectedTitleColor:(UIColor *)selectedColor Target:(id)target Action:(SEL)action titleFont:(UIFont *)font backgroundColor:(UIColor *)bgColor tag:(NSInteger)tag; +(UIButton*)createButtonWithFrame:(CGRect)frame backgroundImageName:(NSString*)imageName selectedImage:(NSString *)selected Target:(id)target Action:(SEL)action Title:(NSString*)title tag:(NSInteger)tag; /** action title titleColor font backgroudColor*/ +(UIButton*)createButtonWithFrame:(CGRect)frame Target:(id)target Action:(SEL)action Title:(NSString*)title titlColor:(UIColor *)color font:(UIFont *)textFont tag:(NSInteger)tag backgroundColor:(UIColor *)backgroudColor; /** action title imageName font */ +(UIButton*)createButtonWithFrame:(CGRect)frame ImageName:(NSString*)imageName Target:(id)target Action:(SEL)action font:(UIFont *)font Title:(NSString*)title; /** action title imageName selected font */ +(UIButton*)createButtonWithFrame:(CGRect)frame ImageName:(NSString*)imageName selectedImage:(NSString *)selected Target:(id)target Action:(SEL)action Title:(NSString*)title tag:(NSInteger)tag; /** title imageName selected font action backgorudColor borderColor borderWidth*/ +(UIButton *)createButtonWithFrame:(CGRect)frame buttonTitleFont:(UIFont *)font buttonTitle:(NSString *)title buttonTitleColor:(UIColor *)titleColor backgorudColor:(UIColor *)backgorudColor borderColor:(CGColorRef)borderColor borderWidth:(CGFloat)borderWidth action:(SEL)action target:(id)target; +(UIButton *)createButtonWithFrame:(CGRect)frame; +(UIButton *)createButtonWithFrame:(CGRect)frame buttonImage:(NSString *)imageName; +(UIButton *)createButtonWithFrame:(CGRect)frame buttonTitleFont:(UIFont *)buttonTitleFont buttonTitle:(NSString *)buttonTitle; ///9月17日 新增 +(UIButton *)createButtonWithFrame:(CGRect)frame buttonType:(UIButtonType)type buttonImage:(NSString *)imageName Target:(id)target Action:(SEL)action; #pragma mark ----- 创建tableView ----- +(UITableView *)createTableViewWithFrame:(CGRect)frame style:(UITableViewStyle)style dataSource:(id)dataSource delegate:(id)delegate; +(UITableView *)createTableViewWithFrame:(CGRect)frame style:(UITableViewStyle)style backgroudColor:(UIColor *)backgroudColor dataSource:(id)dataSource delegate:(id)delegate; +(UITableView *)createTableViewWithFrame:(CGRect)frame style:(UITableViewStyle)style backgroudColor:(UIColor *)backgroudColor dataSource:(id)dataSource delegate:(id)delegate separatorStyle:(UITableViewCellSeparatorStyle)separatorStyle; //** // * 处理 cell上 textfield或者 textView键盘弹出问题 // * // * @param frame // * @param style // * @param backgroudColor // * @param dataSource // * @param delegate // * @param separatorStyle // * // * @return // */ #pragma mark ----- 创建UICollectionView ----- //+(UICollectionView *)createCollectionViewFromFrame:(CGRect)frame // collectionViewLayout:(UICollectionViewLayout *)layout // dataSource:(id)dataSource // delegate:(id)delegate ; // //+(UICollectionView *)createCollectionViewFromFrame:(CGRect)frame // collectionViewLayout:(UICollectionViewLayout *)layout // dataSource:(id)dataSource // delegate:(id)delegate // backgroudColor:(UIColor *)backgroudColor; +(UICollectionView *)createCollectionViewFromFrame:(CGRect)frame itmeSize:(CGSize)itmeSize sectionInset:(UIEdgeInsets)sectionInset minimumLineSpacing:(CGFloat)minimumLineSpacing minimumInteritemSpacing:(CGFloat)minimumInteritemSpacing scrollDirection:(UICollectionViewScrollDirection)scrollDirection dataSource:(id)dataSource delegate:(id)delegate backgroudColor:(UIColor *)backgroudColor; +(UICollectionView *)createCollectionViewFromFrame:(CGRect)frame itmeSize:(CGSize)itmeSize sectionInset:(UIEdgeInsets)sectionInset minimumLineSpacing:(CGFloat)minimumLineSpacing minimumInteritemSpacing:(CGFloat)minimumInteritemSpacing scrollDirection:(UICollectionViewScrollDirection)scrollDirection dataSource:(id)dataSource delegate:(id)delegate backgroudColor:(UIColor *)backgroudColor headerReuseIdentifier:(NSString *)headerReuseIdentifier footerReuseIdentifier:(NSString *)footerReuseIdentifier; #pragma mark 创建UIScrollView +(UIScrollView*)makeScrollViewWithFrame:(CGRect)frame andSize:(CGSize)size; #pragma mark 创建UIPageControl +(UIPageControl*)makePageControlWithFram:(CGRect)frame; #pragma mark 创建UISlider +(UISlider*)makeSliderWithFrame:(CGRect)rect AndImage:(UIImage*)image; #pragma mark 创建时间转换字符串 +(NSString *)stringFromDateWithHourAndMinute:(NSDate *)date; #pragma mark 内涵图需要的方法 + (NSString *)stringDateWithTimeInterval:(NSString *)timeInterval; + (CGFloat)textHeightWithString:(NSString *)text width:(CGFloat)width fontSize:(NSInteger)fontSize; + (NSString *)addOneByIntegerString:(NSString *)integerString; +(void)changeTextColorWithLabel:(UILabel*)label changeStr:(NSString *)str color:(UIColor *)color; +(void)changeTextColorWithLabel:(UILabel *)label range:(NSRange)range color:(UIColor *)color; +(void)changeTextFontWithLabel:(UILabel*)label range:(NSRange)range font:(UIFont *)font; +(void)changeTextFontWithLabel:(UILabel*)label changeStr:(NSString *)str font:(UIFont *)font; +(void)changeTextWithLabel:(UILabel*)label changeStr:(NSString *)str font:(UIFont *)font andColor:(UIColor *)color; +(void)changeTextFontWithLabel:(UILabel*)label changeStrings:(NSArray *)strings font:(UIFont *)font; +(void)changeTextColorWithlabel:(UILabel *)label changeStrings:(NSArray *)strings color:(UIColor *)color; +(void)changeTextColorWithlabel:(UILabel *)label changeString:(NSString *)str backGroudColor:(UIColor *)backColor color:(UIColor *)color; +(void)addUnderLineWithLabel:(UILabel *)label changeStr:(NSString *)str; +(void)addUnderLineWithLabel:(UILabel *)label changeStr:(NSString *)str andFont:(UIFont *)font; +(void)addUnderLineWithLabel:(UILabel *)label changeStr:(NSString *)str andFont:(UIFont *)font andColor:(UIColor *)color; +(void)addUnderLineWithLabel:(UILabel *)label range:(NSRange)range andFont:(UIFont *)font; +(void)addUnderLineWithLabel:(UILabel *)label range:(NSRange)range andFont:(UIFont *)font andColor:(UIColor *)color; ///动态获取label的高 9月17日新增 +(CGFloat)loadDynamicLabelHeightWithLabel:(UILabel *)lab; ///动态获取label的宽 9月17日新增 +(CGFloat)loadDynamicLabelWidthWithLabel:(UILabel *)lab; @end