简体   繁体   English

Scrollview动画不流畅(Objective-C)

[英]Scrollview animation not smooth (objective-C)

I am trying to scroll my scroll view up when the textFieldDidBeginEditing delegate method is called. 我正在尝试在调用textFieldDidBeginEditing委托方法时滚动我的滚动视图。 It works, but there is one buggy issue. 它有效,但有一个错误的问题。 On the FIRST call of the method (when the user taps the textview for the FIRST time, the animation is not smooth, and instantaneous jumps to the topPoint. Every animation afterwards is smooth. Why is the first animation not smooth like the other ones? Am I missing something? 在方法的第一次调用时(当用户第一次点击文本视图时,动画不平滑,瞬间跳转到topPoint。之后的每个动画都是平滑的。为什么第一个动画不像其他动画那样平滑?我错过了什么吗?

- (void)textFieldDidBeginEditing:(UITextField *)textField
{
    CGPoint topPoint;
    topPoint = CGPointMake(0, 200);
    [self.scrollView setContentOffset:topPoint animated:YES];
}

这只发生在插入调试器时。它甚至会引起音频故障,我失去了几个小时的工作,甚至无缘无故地提交雷达:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM