Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/104.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何使UITextView保持在底部滚动_Ios_Objective C_Ios6_Scroll_Uitextview - Fatal编程技术网

Ios 如何使UITextView保持在底部滚动

Ios 如何使UITextView保持在底部滚动,ios,objective-c,ios6,scroll,uitextview,Ios,Objective C,Ios6,Scroll,Uitextview,我正在编程,突然发现UITextView有问题, 我想要的是它被锚定到UITextView的底部,因为我的应用程序会自动添加行和文本,我需要UITextView保持在底部,这样用户可以在他们通过时阅读它们。现在我已经找到了一种方法,但是它使用滚动,它跟不上应用程序输入的速度,或者它跳到很远的地方,然后你看不到任何东西,看起来很凌乱,所以下面是代码 CGPoint scrollPoint = self.codeBox.contentOffset; // initial and after upd

我正在编程,突然发现UITextView有问题, 我想要的是它被锚定到UITextView的底部,因为我的应用程序会自动添加行和文本,我需要UITextView保持在底部,这样用户可以在他们通过时阅读它们。现在我已经找到了一种方法,但是它使用滚动,它跟不上应用程序输入的速度,或者它跳到很远的地方,然后你看不到任何东西,看起来很凌乱,所以下面是代码

 CGPoint scrollPoint = self.codeBox.contentOffset; // initial and after update

scrollPoint = CGPointMake(0, scrollPoint.y +1); // makes scroll
[self.codeBox setContentOffset:scrollPoint animated:NO];
就像我说的,我想找到一种方法让UITextView保持在底部,而不会出现任何混乱的滚动。任何帮助都将不胜感激,P.S我是Objective-C的新手,请尝试调用
-(void)scrollRectToVisible:(cRect)rect animated:(BOOL)animated
(UIScrollView的一种方法,UITextView是其子类) 或
-(void)scrollRangeToVisible:(NSRange)range
哪个更特定于UITextView