당신이 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
작동하지