Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有时候需求需要切换跑马灯文案,且需要每次都完整出来 #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions TXScrollLabelView/TXScrollLabelView.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ typedef NS_ENUM(NSInteger, TXScrollLabelViewType) {
inset:(UIEdgeInsets)inset;

#pragma mark - Operation Methods

/**
当需要重置位置的赋值的时候
*/
- (void)resetPosition;

/**
* 开始滚动
*/
Expand Down
25 changes: 25 additions & 0 deletions TXScrollLabelView/TXScrollLabelView.m
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,31 @@ - (void)updateUpDownScrollLabelLayoutWithText:(NSString *)text labelType:(TXScro

#pragma mark - Scrolling Operation Methods -- Public

- (void)resetPosition
{
self.contentOffset = CGPointMake(0, 0);
switch (_scrollType) {
case TXScrollLabelViewTypeLeftRight:
[self setupSubviewsLayout_LeftRight];
break;
case TXScrollLabelViewTypeUpDown:
[self setupSubviewsLayout_UpDown];
break;
case TXScrollLabelViewTypeFlipRepeat: {
[self setupSubviewsLayout_Flip];
[self setupTitle:_scrollTitle];
}
break;
case TXScrollLabelViewTypeFlipNoRepeat:
[self setupSubviewsLayout_Flip];
break;

default:
break;
}
}


- (void)beginScrolling {
self.currentSentence = 0;
if (self.isArray) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>