CNLiveBarrageAnimationView.h
1.75 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
//
// barrageAnimationView.h
//
// Created by CNLive on 16/8/3.
// Copyright © 2016年 CNLive. All rights reserved.
//
#import <UIKit/UIKit.h>
//承载弹幕动画的view
@interface CNLiveBarrageAnimationView : UIView
/*
* 获取SDK版本号
*/
+ (NSString *)getVersion;
/* 初始化 barrageAnimationView
*
* frame中height此时设置是无效的
* height将根据提供的行数和用来做弹幕动画的label的height决定
*
*/
- (instancetype)initWithFrame:(CGRect)frame;
/* 设置弹幕的行数
*
* 弹幕启动后设置无效
* 默认1行
*
*/
- (void)setLinage:(NSInteger)linage;
/* 设置弹幕文字到弹幕载体边缘的间隔
*
* 弹幕启动后设置无效
* 默认为0
*
*/
- (void)setHorizontalSpace:(CGFloat)hSpace;
/* 设置弹幕与弹幕之间上下的间隔
*
* 弹幕启动后设置无效
* 默认为0
*
*/
- (void)setVerticalSpace:(CGFloat)vSpace;
/* 设置弹幕动画的持续时间
*
* 弹幕启动后设置无效
* 默认5秒
*
*/
- (void)setAnimationDuration:(CGFloat)duration;
/* 设置弹幕的样式
*
* 弹幕启动后设置无效
*
* 通过传入label的属性来设置弹幕的样式
*
* 目前支持设置的属性有如下
* frame中的height
* backgroundColor
* font
* textColor
* layer.cornerRadius
* layer.masksToBounds
* layer.borderColor
* layer.borderWidth
*
*/
- (void)setBarrageLabelStyle:(UILabel *)styleLabel;
/* 启动弹幕
*
* 未启动时也会保留传入的弹幕内容
*
*/
- (void)startAnimation;
/* 关闭弹幕
*
* 调用时正在做动画的弹幕将立即消失
* 等待做动画的弹幕继续保留
* 再次调用startAnimation将继续展示
*
*/
- (void)stopAnimation;
// 传入需要展示的弹幕内容
- (void)showBarrageContent:(NSString *)content;
@end