45 lines
999 B
Objective-C
Executable File
45 lines
999 B
Objective-C
Executable File
//
|
||
// UILabel+ChangeSpace.h
|
||
// romantic
|
||
//
|
||
// Created by bj_szd on 2022/4/9.
|
||
// Copyright © 2022 romantic. All rights reserved.
|
||
//
|
||
|
||
#import <UIKit/UIKit.h>
|
||
|
||
NS_ASSUME_NONNULL_BEGIN
|
||
|
||
@interface UILabel (ChangeSpace)
|
||
|
||
- (void)topAlignment;
|
||
- (void)bottomAlignment;
|
||
/**
|
||
* 改变行间距
|
||
*/
|
||
+ (void)changeLineSpaceForLabel:(UILabel *)label WithSpace:(float)space;
|
||
|
||
/**
|
||
* 改变字间距
|
||
*/
|
||
+ (void)changeWordSpaceForLabel:(UILabel *)label WithSpace:(float)space;
|
||
|
||
/**
|
||
* 改变行间距和字间距
|
||
*/
|
||
+ (void)changeSpaceForLabel:(UILabel *)label withLineSpace:(float)lineSpace WordSpace:(float)wordSpace;
|
||
|
||
/**
|
||
改变label文字中某段文字的颜色,大小
|
||
label 传入label(传入前要有文字)
|
||
oneW 从第一个文字开始
|
||
size 尺寸
|
||
*/
|
||
- (void)LabelAttributedString:(UILabel*)label firstW:(NSString *)oneW size:(CGFloat)size;
|
||
|
||
+ (CGFloat)textHeight:(NSString *)text font:(UIFont *)font width:(CGFloat)width lineSpace:(CGFloat)lineSpace;
|
||
|
||
@end
|
||
|
||
NS_ASSUME_NONNULL_END
|