あなたはUITextViewを使用していることを確認してくださいあなたはscrollRangeToVisible
のアニメーションの速度を変更することはできませんが、あなたがcontentOffset
を使用することができ、これは
uint offset1=-1;
uint offset2=0;
UITextPosition *Pos2 = [_textView positionFromPosition: _textView.endOfDocument offset: offset2];
UITextPosition *Pos1 = [_textView positionFromPosition: _textView.endOfDocument offset: offset1];
UITextRange *range = [_textView textRangeFromPosition:Pos1 toPosition:Pos2];
CGRect result1 = [_textView firstRectForRange:(UITextRange *)range];
result1.origin.x=0;//reset x position to zero
[UIView animateWithDuration:3.0 delay:0.0 options:UIViewAnimationOptionCurveLinear
animations:^{
_textView.contentOffset = result1.origin;
}
completion:^(BOOL finished){
}];
UITextFieldの
では動作しません