HDMarqueeView.h 1.64 KB
Newer Older
Han Ruisong's avatar
Han Ruisong committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//
//  HDMarqueeView.h
//  HDMarqueeTool
//
//  Created by zwl on 2020/3/9.
//  Copyright © 2020 zwl. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
@class HDMarqueeAction;

typedef NS_ENUM(NSUInteger, HDMarqueeViewStyle) {
    HDMarqueeViewStyleTitle,//文字样式
    HDMarqueeViewStyleImage //图片样式
};

///跑马灯控件
@interface HDMarqueeView : UIView

Hanruisong's avatar
Hanruisong committed
21
22
23
/**
 *  @brief 父视图,必填
 */
Han Ruisong's avatar
Han Ruisong committed
24
25
@property(nonatomic,assign)UIView * fatherView;

Hanruisong's avatar
Hanruisong committed
26
27
28
/**
 *  @brief 跑马灯样式,默认文字样式
 */
Han Ruisong's avatar
Han Ruisong committed
29
30
@property(nonatomic,assign)HDMarqueeViewStyle style;

Hanruisong's avatar
Hanruisong committed
31
32
33
/**
 *  @brief 跑马灯文字内容
 */
Han Ruisong's avatar
Han Ruisong committed
34
35
@property(nonatomic,copy)NSString * text;

Hanruisong's avatar
Hanruisong committed
36
37
38
/**
 *  @brief 跑马灯文字格式
 */
Han Ruisong's avatar
Han Ruisong committed
39
40
@property(nonatomic,copy)NSDictionary * textAttributed;

Hanruisong's avatar
Hanruisong committed
41
42
43
/**
 *  @brief 跑马灯文字对齐方式,默认kCAAlignmentNatural
 */
Han Ruisong's avatar
Han Ruisong committed
44
45
@property(nonatomic,copy)NSString * textAlignmentMode;

Hanruisong's avatar
Hanruisong committed
46
47
48
/**
 *  @brief 跑马灯文字显示不全时,裁剪方式,默认kCATruncationNone
 */
Han Ruisong's avatar
Han Ruisong committed
49
50
@property(nonatomic,copy)NSString * textTruncationMode;

Hanruisong's avatar
Hanruisong committed
51
52
53
/**
 *  @brief 跑马灯文字是否自动换行,默认NO
 */
Han Ruisong's avatar
Han Ruisong committed
54
55
@property(nonatomic,assign)BOOL wrapped;

Hanruisong's avatar
Hanruisong committed
56
57
58
/**
 *  @brief 跑马灯图片
 */
Han Ruisong's avatar
Han Ruisong committed
59
60
@property(nonatomic,strong)NSURL * imageURL;

Hanruisong's avatar
Hanruisong committed
61
62
63
/**
 *  @brief 跑马灯效果,必填
 */
Han Ruisong's avatar
Han Ruisong committed
64
65
@property(nonatomic,strong)NSArray <HDMarqueeAction *> * actions;

Hanruisong's avatar
Hanruisong committed
66
67
68
/**
 *  @brief 循环次数,默认1,0表示无限循环
 */
Han Ruisong's avatar
Han Ruisong committed
69
70
@property(nonatomic,assign)NSInteger repeatCount;

Hanruisong's avatar
Hanruisong committed
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*!
 * @method
 * @abstract 开始跑马灯
 * @discussion 开始跑马灯
 */
-(void)startMarquee;

/*!
 * @method
 * @abstract 结束跑马灯
 * @discussion 结束跑马灯
 */
-(void)stopMarquee;

Han Ruisong's avatar
Han Ruisong committed
85
86
@end