NoiseView.h
4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//
// NoiseView.h
// DreamSleep
//
// Created by peter on 2022/5/12.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/**
下划线长度取值类型
- LineWidthTypeStaticShort: 静态短长度,取个固定短值
- LineWidthTypeStaticLong: 静态长度,根据总长度/数量
- LineWidthTypeDynamic: 动态长度,根据文字长度
*/
typedef NS_ENUM(NSInteger, LineWidthType) {
LineWidthTypeStaticShort = 0,
LineWidthTypeStaticLong,
LineWidthTypeDynamic
};
/**
分页条目 cell 宽度取值类型
- PageCellWidthTypeWithTitleLength: 根据 cell 标题文字长度取值
- PageCellWidthTypeSplitScreen: pageCell个数小于屏宽最大cell展示个数时,按个数平分屏宽
- PageCellWidthTypeWidthByStaticCount: 根据屏宽最大cell展示个数平分屏宽
*/
typedef NS_ENUM(NSInteger, PageCellWidthType) {
PageCellWidthTypeByTitleLength = 0,
PageCellWidthTypeSplitScreen,
PageCellWidthTypeWidthByStaticCount
};
/**
下划线在条目切换时的动态表现类型
- LineScrollTypeDynamicAnimation: 滑动即时的下划线动态动画
- LineScrollTypeDynamicLinear: 滑动即时的下划线线性动画
- LineScrollTypeFinishedLinear: 滑动完成后的下划线线性动画
*/
typedef NS_ENUM(NSInteger, LineScrollType) {
LineScrollTypeDynamicAnimation = 0,
LineScrollTypeDynamicLinear,
LineScrollTypeScrollEndLinear
};
/** 分页滑动时标题字体大小改变方式
- PageTitleFontChangeTypeScrolling: 滑动中实时改变
- PageTitleFontChangeTypeScrollEnd: 滑动结束无动画改变
- PageTitleFontChangeTypeScrollEndAnimation: 滑动结束动画改变
*/
typedef NS_ENUM(NSInteger, PageTitleFontChangeType) {
PageTitleFontChangeTypeScrolling = 0,
PageTitleFontChangeTypeScrollEnd,
PageTitleFontChangeTypeScrollEndAnimation
};
/** 分页滑动时标题颜色改变方式
- PageTitleColorChangeTypeScrolling: 滑动中实时改变
- PageTitleColorChangeTypeScrollEnd: 滑动结束改变
*/
typedef NS_ENUM(NSInteger, PageTitleColorChangeType) {
PageTitleColorChangeTypeScrolling = 0,
PageTitleColorChangeTypeScrollEnd
};
/// 首页白噪音自定义view
@interface NoiseView : UIView
/// 配置分页类型数据
/// @param data data
- (void)refreshNoiseTypeData:(NSArray *)data;
/// 初始化
/// @param data data
- (instancetype)initWithNoiseTypeData:(NSArray *)data;
/** 分页条高度 */
@property(nonatomic, assign) CGFloat pageBarHeight;
/** 分页条背景色 */
@property (nonatomic,strong) UIColor *pageBarBgColor;
/** 下滑线颜色 */
@property (nonatomic,strong) UIColor *lineColor;
/** 下滑线颜色数组 */
@property (nonatomic,strong) NSArray *lineColors;
/** 下滑线高度 */
@property (nonatomic,assign) CGFloat lineHeight;
/** 下划线固定宽度: lineWidthType=LineWidthTypeStaticShort时设置,其他类型自动计算 */
@property (nonatomic,assign) CGFloat lineStaticWidth;
/** 分页工具条在展示区域的条目数量展示最大值: 在导航条上时默认值4,在一屏宽度上时默认值5 */
@property (nonatomic,assign) NSInteger maxPagesCountInPageShowArea;
/** 下划线长度取值类型 */
@property (nonatomic,assign) LineWidthType lineWidthType;
/** 下划线在条目切换时的动态表现类型 */
@property (nonatomic,assign) LineScrollType lineScrollType;
/** 分页条目 cell 宽度取值类型 */
@property (nonatomic,assign) PageCellWidthType pageCellWidthType;
/** 分页滑动时标题字体大小改变方式 */
@property (nonatomic,assign) PageTitleFontChangeType pageTitleFontChangeType;
/** 分页滑动时标题颜色改变方式 */
@property (nonatomic,assign) PageTitleColorChangeType pageTitleColorChangeType;
/** 标题颜色 */
@property (nonatomic,strong) UIColor *titleColor;
/** 标题选中颜色(可不设置) */
@property (nonatomic,strong) UIColor *titleSelectedColor;
/** 标题字体, default: [UIFont systemFontOfSize:15] */
@property (nonatomic,strong) UIFont *titleFont;
/** 标题选中字体(可不设置), default: [UIFont systemFontOfSize:20] */
@property (nonatomic,strong) UIFont *titleSelectedFont;
/** 默认选择的 index 位置 ,默认值为0*/
@property (nonatomic,assign) NSInteger defaultIndex;
/** 分页控制器View视图的 Y 轴方向 设置初始位置(适用于分页条不在导航条上的情况) , 动态位置由于UICollectionViewCell 的复用存在不可知 bug, 暂不实现*/
@property (nonatomic, assign) CGFloat originY;
@end
NS_ASSUME_NONNULL_END