Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
adjust isCounterclockwise(JhtVerticalMarquee)
  • Loading branch information
jinht committed Jun 5, 2018
1 parent baf2725 commit 79e5705
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
9 changes: 8 additions & 1 deletion JhtMarquee.framework/Headers/JhtVerticalMarquee.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
/** 当前展示内容 索引 */
@property (nonatomic, assign, readonly) NSInteger currentIndex;

/** 是否为逆时针滚动
* default:NO
* 顺时针:底部 ===> 顶部
* 逆时针:顶部 ===> 底部
*/
@property (nonatomic, assign) BOOL isCounterclockwise;

/** 单次滚动 时间
* default:0.5f
*/
Expand Down Expand Up @@ -55,7 +62,7 @@

#pragma mark - Public Method
/** 设置跑马灯状态
* marqueeState:跑马灯状态(MarqueeState_V)
* marqueeState:状态(MarqueeState_V)
*/
- (void)marqueeOfSettingWithState:(MarqueeState_V)marqueeState;

Expand Down
Binary file modified JhtMarquee.framework/JhtMarquee
Binary file not shown.
Binary file not shown.
29 changes: 14 additions & 15 deletions JhtMarquee/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#import <JhtMarquee/JhtVerticalMarquee.h>
#import <JhtMarquee/JhtHorizontalMarquee.h>

/** 屏幕的宽度 */

#define FrameW [UIScreen mainScreen].bounds.size.width

@interface ViewController () <UIGestureRecognizerDelegate> {
Expand Down Expand Up @@ -55,7 +55,6 @@ - (void)viewDidLoad {

self.automaticallyAdjustsScrollViewInsets = NO;


#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
self.navigationController.interactivePopGestureRecognizer.delegate = self;
Expand Down Expand Up @@ -120,6 +119,7 @@ - (void)addVerticalMarquee {
@"3. 谁又从谁的雨季里消失,泛滥了眼泪",
@"4. 人生路,路迢迢,谁道自古英雄多寂寥,若一朝,看透了,一身清风挣多少"];

// self.verticalMarquee.isCounterclockwise = YES;
self.verticalMarquee.sourceArray = soureArray;

// 开始滚动
Expand All @@ -134,8 +134,9 @@ - (JhtHorizontalMarquee *)horizontalMarquee {
if (!_horizontalMarquee) {
_horizontalMarquee = [[JhtHorizontalMarquee alloc] initWithFrame:CGRectMake(0, 66, FrameW, 40) withSingleScrollDuration:10.0];

_horizontalMarquee.tag = 100;
// 添加点击手势
UITapGestureRecognizer *htap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(horizontalMarqueeTapGes:)];
UITapGestureRecognizer *htap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(marqueeTapGes:)];
[_horizontalMarquee addGestureRecognizer:htap];
}

Expand All @@ -147,11 +148,12 @@ - (JhtVerticalMarquee *)verticalMarquee {
if (!_verticalMarquee) {
_verticalMarquee = [[JhtVerticalMarquee alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.horizontalMarquee.frame) + 40, FrameW - 20, 45)];

_verticalMarquee.tag = 101;
_verticalMarquee.backgroundColor = [UIColor yellowColor];
_verticalMarquee.verticalTextColor = [UIColor purpleColor];

// 添加点击手势
UITapGestureRecognizer *vtap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(verticalMarqueeTapGes:)];
UITapGestureRecognizer *vtap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(marqueeTapGes:)];
[_verticalMarquee addGestureRecognizer:vtap];
}

Expand All @@ -160,18 +162,15 @@ - (JhtVerticalMarquee *)verticalMarquee {


#pragma mark Get Method
/** 点击 水平滚动跑马灯 触发方法 */
- (void)horizontalMarqueeTapGes:(UITapGestureRecognizer *)ges {
NSLog(@"点击__水平__滚动的跑马灯啦!!!");
[self.verticalMarquee marqueeOfSettingWithState:MarqueePause_V];
_isPauseV = YES;
/** 点击 滚动跑马灯 触发方法 */
- (void)marqueeTapGes:(UITapGestureRecognizer *)ges {
if (ges.view.tag == 100) {
NSLog(@"点击__水平__滚动的跑马灯啦!!!");

} else if (ges.view.tag == 101) {
NSLog(@"点击__纵向__滚动的跑马灯_第 %ld 条数据啦!!!", (long)self.verticalMarquee.currentIndex);
}

[self.navigationController pushViewController:[[testVC alloc] init] animated:YES];
}

/** 点击 纵向滚动跑马灯 触发方法 */
- (void)verticalMarqueeTapGes:(UITapGestureRecognizer *)ges {
NSLog(@"点击__纵向__滚动的跑马灯_第 %ld 条数据啦!!!", (long)self.verticalMarquee.currentIndex);
[self.verticalMarquee marqueeOfSettingWithState:MarqueePause_V];
_isPauseV = YES;

Expand Down

0 comments on commit 79e5705

Please sign in to comment.