【发布时间】:2014-09-04 16:23:38
【问题描述】:
我自己实现了让 UITextView 一直上下滚动(显然提供选项 UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse 不适用于 iOS 7 中的 setContentOffSet)。
所以代码让我的 UITextView(不可编辑和选择)上下滚动。无论如何,当它开始向下滚动时, UITextView 的第一行就会消失。当它再次向上滚动时,该行再次显示(直到开始向下滚动动画)。
我已经检查过没有其他视图隐藏第一行。
我真的被困在这里,因为这似乎是框架的一些错误,但我找不到合适的解决方法。
[UIView animateWithDuration:1.5f
delay:0.3f
options:UIViewAnimationOptionCurveLinear
animations:^{
[self.detailTextTop setContentOffset:CGPointMake(0, maxScrollPoint) animated:NO];
}
completion:^(BOOL finished) {
if (shouldScroll) {
__weak id weakSelf = self;
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
[weakSelf performSelector:@selector(scrollNote) withObject:self afterDelay:1.5];
}];
}
}
];
【问题讨论】:
标签: ios objective-c uitextview