• <small id='hpN8I'></small><noframes id='hpN8I'>

  • <legend id='hpN8I'><style id='hpN8I'><dir id='hpN8I'><q id='hpN8I'></q></dir></style></legend>
      <bdo id='hpN8I'></bdo><ul id='hpN8I'></ul>
    <tfoot id='hpN8I'></tfoot>

    1. <i id='hpN8I'><tr id='hpN8I'><dt id='hpN8I'><q id='hpN8I'><span id='hpN8I'><b id='hpN8I'><form id='hpN8I'><ins id='hpN8I'></ins><ul id='hpN8I'></ul><sub id='hpN8I'></sub></form><legend id='hpN8I'></legend><bdo id='hpN8I'><pre id='hpN8I'><center id='hpN8I'></center></pre></bdo></b><th id='hpN8I'></th></span></q></dt></tr></i><div id='hpN8I'><tfoot id='hpN8I'></tfoot><dl id='hpN8I'><fieldset id='hpN8I'></fieldset></dl></div>

      1. 以编程方式使 uitextview 滚动

        Making uitextview scroll programmatically(以编程方式使 uitextview 滚动)

          1. <i id='pn19I'><tr id='pn19I'><dt id='pn19I'><q id='pn19I'><span id='pn19I'><b id='pn19I'><form id='pn19I'><ins id='pn19I'></ins><ul id='pn19I'></ul><sub id='pn19I'></sub></form><legend id='pn19I'></legend><bdo id='pn19I'><pre id='pn19I'><center id='pn19I'></center></pre></bdo></b><th id='pn19I'></th></span></q></dt></tr></i><div id='pn19I'><tfoot id='pn19I'></tfoot><dl id='pn19I'><fieldset id='pn19I'></fieldset></dl></div>
            • <small id='pn19I'></small><noframes id='pn19I'>

              <legend id='pn19I'><style id='pn19I'><dir id='pn19I'><q id='pn19I'></q></dir></style></legend>
              <tfoot id='pn19I'></tfoot>
                <tbody id='pn19I'></tbody>

                  <bdo id='pn19I'></bdo><ul id='pn19I'></ul>

                • 本文介绍了以编程方式使 uitextview 滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想让我的 uitextview 在应用程序启动时自动滚动.谁能帮我详细的代码?我是 iPhone SDK 的新手.

                  I want to make my uitextview to scroll automatically whenever the application is launched. Can anyone help me with a detailed code? I am new to iPhone SDK.

                  推荐答案

                  .h文件

                  @interface Credits : UIViewController 
                  {
                      NSTimer *scrollingTimer;
                  
                      IBOutlet UITextView *textView;
                  
                  
                  }
                  @property (nonatomic , retain) IBOutlet UITextView *textView;
                  
                  - (IBAction) buttonClicked ;
                  
                  - (void) autoscrollTimerFired;
                  
                  @end
                  

                  .m 文件

                  - (void) viewDidLoad
                  {       
                      // it prints the initial position of text view 
                      NSLog(@"%f %f",textView.contentSize.width , textView.contentSize.height);
                  
                      if (scrollingTimer == nil)
                      {
                          // A timer that updates the content off set after some time so it can scroll 
                          // you can change time interval according to your need (0.06)
                          // autoscrollTimerFired is the method that will be called after specified time interval. This method will change the content off set of text view
                          scrollingTimer = [NSTimer scheduledTimerWithTimeInterval:(0.06)
                                           target:self selector:@selector(autoscrollTimerFired) userInfo:nil repeats:YES];        
                      }
                  }
                  
                  - (void) autoscrollTimerFired
                  {
                      CGPoint scrollPoint = self.textView.contentOffset; // initial and after update
                      NSLog(@"%.2f %.2f",scrollPoint.x,scrollPoint.y);
                      if (scrollPoint.y == 583) // to stop at specific position 
                      {
                          [scrollingTimer invalidate];
                          scrollingTimer = nil;
                      }
                      scrollPoint = CGPointMake(scrollPoint.x, scrollPoint.y + 1); // makes scroll
                      [self.textView setContentOffset:scrollPoint animated:NO];
                      NSLog(@"%f %f",textView.contentSize.width , textView.contentSize.height);
                  
                  }
                  

                  希望对你有帮助....

                  Hope it helps you....

                  这篇关于以编程方式使 uitextview 滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)
                  [ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)

                      <i id='cpcfo'><tr id='cpcfo'><dt id='cpcfo'><q id='cpcfo'><span id='cpcfo'><b id='cpcfo'><form id='cpcfo'><ins id='cpcfo'></ins><ul id='cpcfo'></ul><sub id='cpcfo'></sub></form><legend id='cpcfo'></legend><bdo id='cpcfo'><pre id='cpcfo'><center id='cpcfo'></center></pre></bdo></b><th id='cpcfo'></th></span></q></dt></tr></i><div id='cpcfo'><tfoot id='cpcfo'></tfoot><dl id='cpcfo'><fieldset id='cpcfo'></fieldset></dl></div>

                        <tbody id='cpcfo'></tbody>

                      <tfoot id='cpcfo'></tfoot>
                      • <legend id='cpcfo'><style id='cpcfo'><dir id='cpcfo'><q id='cpcfo'></q></dir></style></legend>

                        1. <small id='cpcfo'></small><noframes id='cpcfo'>

                          • <bdo id='cpcfo'></bdo><ul id='cpcfo'></ul>