Skip to content

Commit 6b3f590

Browse files
committed
[UPDATE] 0.0.3
1 parent 513f97a commit 6b3f590

3 files changed

Lines changed: 49 additions & 9 deletions

File tree

README.md

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![](https://img.shields.io/badge/platform-iOS-green.svg)
44
![](https://img.shields.io/badge/pod-v1.6.0.beta.1-blue.svg)
55
![](https://img.shields.io/badge/language-ObjectiveC-purple.svg)
6-
![](https://img.shields.io/badge/moduleVersion-v0.0.2-red.svg)
6+
![](https://img.shields.io/badge/moduleVersion-v0.0.3-red.svg)
77

88
Automatically scrolling UILabel with both horizontal/vertical MARQUEE effects and gradient gradients on the edges.Gradient fading is used on the edge of the scroll to solve the problem of the hard edges of the rolling edge. The overall effect is a natural and easy to use.
99

@@ -28,10 +28,32 @@ Step 1: Execute `git clone git@github.com:shevakuilin/SKAutoScrollLabel.git`,t
2828

2929
Step 2: Copy the `SKAutoScrollLabel` from the directory directly into your project, or add `pod 'SKAutoScrollLabel'` to the Podfile.
3030

31+
Step 3: Reference header file `#import <SKAutoScrollLabel/SKAutoScrollLabel.h>`
32+
3133
# Installation
3234

35+
#### Created by code
36+
3337
```objectivec
34-
SKAutoScrollLabel *scrollLabel = [[SKAutoScrollLabel alloc] initWithTextContent:@"Fly me to the moon.Let me play among the stars.Let me see what spring is like on Jupiter and Mars.In other words, hold my hand.In other words, baby, kiss me." direction:self.scrollType];
38+
// Scroll from right to left
39+
SKAutoScrollLabel *scrollLabel = [[SKAutoScrollLabel alloc] initWithTextContent:@"Fly me to the moon.Let me play among the stars.Let me see what spring is like on Jupiter and Mars.In other words, hold my hand.In other words, baby, kiss me." direction: SK_AUTOSCROLL_DIRECTION_LEFT];
40+
scrollLabel.backgroundColor = [UIColor orangeColor];
41+
scrollLabel.textColor = [UIColor whiteColor];
42+
// ... other settings
43+
```
44+
45+
#### Created by storyboard
46+
47+
```objectivec
48+
// Set the object's class to SKAutoScrollLabel in the storyboard
49+
@property (weak, nonatomic) IBOutlet SKAutoScrollLabel *scrollLabel;
50+
51+
// Scroll from right to left
52+
self.scrollLabel.textContent = @"Fly me to the moon.Let me play among the stars.Let me see what spring is like on Jupiter and Mars.In other words, hold my hand.In other words, baby, kiss me.";
53+
self.scrollLabel.direction = SK_AUTOSCROLL_DIRECTION_LEFT;
54+
self.scrollLabel.backgroundColor = [UIColor orangeColor];
55+
self.scrollLabel.textColor = [UIColor whiteColor];
56+
// ... other settings
3557
```
3658

3759
# Parameter meaning
@@ -97,17 +119,35 @@ SKAutoScrollLabel是一个同时支持水平/垂直两种类型的“跑马灯
97119

98120
2.直接将目录下的 SKAutoScrollLabel 拷贝到你的工程中,或在Podfile文件中添加 ```pod 'SKAutoScrollLabel'```
99121

122+
3.引用头文件 `#import <SKAutoScrollLabel/SKAutoScrollLabel.h>`
123+
124+
# 初始化
100125

101-
# 使用方法
126+
#### 通过代码创建
102127

103-
#### 初始化
128+
```objectivec
129+
// 创建一个从右向左滚动的,背景颜色为橙色,字体颜色为白色的滚动 Label
130+
SKAutoScrollLabel *scrollLabel = [[SKAutoScrollLabel alloc] initWithTextContent:@"你指尖跃动的电光, 是我此生不灭的信仰! 唯我超电磁炮永世长存!! 哔哩哔哩(゜-゜)つロ干杯~-bilibili" direction: SK_AUTOSCROLL_DIRECTION_LEFT];
131+
scrollLabel.backgroundColor = [UIColor orangeColor];
132+
scrollLabel.textColor = [UIColor whiteColor];
133+
// ... 其他设置
134+
```
104135
136+
#### 通过 storyboard 创建
105137
106138
```objectivec
107-
SKAutoScrollLabel *scrollLabel = [[SKAutoScrollLabel alloc] initWithTextContent:@"你指尖跃动的电光, 是我此生不灭的信仰! 唯我超电磁炮永世长存!! 哔哩哔哩(゜-゜)つロ干杯~-bilibili" direction:self.scrollType];
139+
// 在 storyboard 中将对象的类设置为 SKAutoScrollLabel
140+
@property (weak, nonatomic) IBOutlet SKAutoScrollLabel *scrollLabel;
141+
142+
// 创建一个从右向左滚动的,背景颜色为橙色,字体颜色为白色的滚动 Label
143+
self.scrollLabel.textContent = @"你指尖跃动的电光, 是我此生不灭的信仰! 唯我超电磁炮永世长存!! 哔哩哔哩(゜-゜)つロ干杯~-bilibili";
144+
self.scrollLabel.direction = SK_AUTOSCROLL_DIRECTION_LEFT;
145+
self.scrollLabel.backgroundColor = [UIColor orangeColor];
146+
self.scrollLabel.textColor = [UIColor whiteColor];
147+
// ... 其他设置
108148
```
109149

110-
#### 基本参数
150+
# 基本参数
111151

112152
- `direction` 滚动方向
113153
- SK_AUTOSCROLL_DIRECTION_RIGHT // 从左向右滚动, 默认选项
@@ -132,7 +172,7 @@ SKAutoScrollLabel *scrollLabel = [[SKAutoScrollLabel alloc] initWithTextContent:
132172

133173
- `enableFade` 开关梯度渐变,默认开启
134174

135-
#### 控制方法
175+
# 控制方法
136176

137177
```objc
138178
- (void)pauseScroll; // 暂停滚动

SKAutoScrollLabel.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "SKAutoScrollLabel"
3-
s.version = "0.0.2"
3+
s.version = "0.0.3"
44
s.summary = "水平/垂直跑马灯"
55
s.description = <<-DESC
66
Automatically scrolling UILabel with both horizontal/vertical MARQUEE effects and gradient gradients on the edges

Source/SKAutoScrollLabel/SKAutoScrollLabel.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ - (CGRect)fixLabelFrameWithDirection:(SK_AUTOSCROLL_DIRECTION)direction {
207207

208208
- (void)creatDisplayLink {
209209
self.displayLinke = [CADisplayLink displayLinkWithTarget:self selector:@selector(processDisplayLink)];
210-
[self.displayLinke addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
210+
[self.displayLinke addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
211211
}
212212

213213
- (void)processDisplayLink {

0 commit comments

Comments
 (0)