keep edit
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// UIView+GradientLayer.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2024/11/18.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UIView (GradientLayer)
|
||||
|
||||
/// 为视图添加渐变背景
|
||||
/// @param colors 渐变颜色数组 (NSArray<UIColor *> *)
|
||||
/// @param startPoint 渐变起点 (CGPoint)
|
||||
/// @param endPoint 渐变终点 (CGPoint)
|
||||
/// @param cornerRadius 圆角半径 (CGFloat)
|
||||
- (void)addGradientBackgroundWithColors:(NSArray<UIColor *> *)colors
|
||||
startPoint:(CGPoint)startPoint
|
||||
endPoint:(CGPoint)endPoint
|
||||
cornerRadius:(CGFloat)cornerRadius;
|
||||
|
||||
/// 移除渐变背景
|
||||
- (void)removeGradientBackground;
|
||||
|
||||
/// 更新渐变背景
|
||||
/// @param colors 渐变颜色数组 (NSArray<UIColor *> *)
|
||||
/// @param startPoint 渐变起点 (CGPoint)
|
||||
/// @param endPoint 渐变终点 (CGPoint)
|
||||
- (void)updateGradientBackgroundWithColors:(NSArray<UIColor *> *)colors
|
||||
startPoint:(CGPoint)startPoint
|
||||
endPoint:(CGPoint)endPoint;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
Reference in New Issue
Block a user