cdts/xdts-ios 3/TreeHole/Code/Utility/MTUIViewCreate/UIView+MTCreate.h

76 lines
2.4 KiB
C
Raw Permalink Normal View History

2023-07-27 09:20:00 +08:00
//
// UIView+MTCreate.h
// Meet
//
// Created by ko1o on 2018/9/13.
// Copyright © 2018年 ko1o. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class YYLabel;
@interface UIButton (MTCreate)
+ (UIButton *_Nonnull)mt_commonButtonWithTitle:(NSString *)title target:(id)target action:(SEL)action;
//UIButton 圆角的 纯色背景图
+ (UIButton *)mt_roundButtonWithFrame:(CGRect)frame
title:(NSString *)title
titleColor:(UIColor *)titleColor
backgroundColor:(UIColor *)backgroundColor
adjustsImageWhenHighlighted:(BOOL)adjustsImageWhenHighlighted
target:(id)target
action:(SEL)action;
+ (UIButton *)mt_roundButtonWithFrame:(CGRect)frame
title:(NSString *)title
titleColor:(UIColor *)titleColor
backgroundColor:(UIColor *)backgroundColor;
//image和title垂直居中布局
- (void)mt_centerVertically;
- (void)mt_centerVerticallyWithPadding:(float)padding;
// image在title右边
- (void)mt_imageRight;
- (void)mt_imageRightWithPadding:(float)padding;
@end
@interface UILabel (MTCreate)
+ (UILabel *)mt_labelWithText:(NSString *)text color:(UIColor *)color fontSize:(CGFloat )fontSize;
- (CGSize)mt_sizeToFitMaxSize:(CGSize)maxSize;
+ (UILabel *)mt_titleLabelWithText:(NSString *)text;
@end
@interface UIView (MTCreateGlobal)
//创建可点击操作提醒的富文本YYLabel
//如: 你可以做什么。“操作(高亮点击)"
+ (YYLabel *)mt_createOperationTips:(NSString *)fullString
actionSubString:(NSString *)actionString
actionBlock:(void (^_Nullable)(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) )actionBlock;
- (void)mt_addDashBorder:(CGFloat )lineWidth color:(UIColor *)color lineDashPattern:(NSArray *)lineDashPattern;
- (void)mt_removeDashBorder;
- (void)mt_addBordersToEdge:(UIRectEdge)edge withColor:(UIColor *)color borderWidth:(CGFloat) borderWidth;
- (void)mt_removeBorderOfEdge:(UIRectEdge)edge;
@end
@interface UIColor (MTHelper)
//修改颜色透明度 alphaScale乘以系数
+ (UIColor *_Nullable)mt_colorWithColor:(UIColor *_Nonnull)originColor alphaScale:(CGFloat)alphaScale;
@end
NS_ASSUME_NONNULL_END