ios - How to create auto scrolling UITextView in the Xcode -


When I start the press button, I try to create a UITx view with auto scrolling. And when a button is pressed, it will stop scrolling. Pressing the button is starting again and it will continue to scroll down. How to manage this function I have some code that works with me under this code

  - (zero) viewDidoadload {[Super Viewedload]; // Setup an additional after loading the view, usually from a nib NSLog (@ "% F% F", _ TxVentence Concentions. Width, _txvSentence.contentSize.height); If (scrollingTimer == zero) {scrollingTimer = [NSTimer scheduledTimerWithTimeInterval: (35.0 / 1000.0) Goals: Self Selector: @selector (autoscrollTimerFired :) userInfo: Repeats Not Equal: Yes]; NSLog (@ "% @", scrollingTimer); }} - (zero) autoscrollTimerFired: (NSTimer *) timer {CGPoint scrollPoint = self.txvSentence.contentOffset; // scrollpoint = cp pointmake (scrollpoint.ex, scrollpoint.i + 1); ScrollPoint = _txvSentence.contentOffset; ScrollPoint.y = scrollPoint.y + 1; [_txv Setset Set Content Offset: Scrollpoint Animated: No]; //[self.txvSentence setContentOffset: scrollpoint animated: no]; }   

But I can not stop this animation. And how to set the dynamic duration, as it comes to the end of the text, it automatically closes.

Sorry, because if I do not understand my bad english then please tell me where it will be clearly understood

Try this:.

  self.scrollView.scrollEnabled = NO; CGFloat scrollHeight = 100; // === - (zero) spinWithOptions: (UIViewAnimationOptions) option {// This spin 360 degree completes every 2 seconds [UIView animateWithDuration: 10 Delay: 0 Option: Option Animation: ^ {self.scrollView.contentOffset = CGPointMake (0, scroll down); Completion: ^ (BOOL Finish) {If (Finished) {if (Animating) {// If the flag still determines, keep moving around with motion [self spinWithOptions: UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction]; } Else if {// one last spin, with recession [self spinWithOptions: UIViewAnimationOptionCurveEaseOut] (option = UIViewAnimationOptionCurveEaseOut!); }}}]; } - (zero) start permission {if (animating) (animating = yes; [Self spin features: UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction]; }} - (zero) stopAnimating {// animating a last 90 degree increments = set the flag to prevent spinning after NO; }    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -