Files
yuyin_ios/SweetParty/主类/Others/NewTools/UILabel+ChangeSpace.h
2025-08-08 11:05:33 +08:00

45 lines
999 B
Objective-C
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// 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