2
I've got my UITextView set up for scrolling like this,
-(void)startAutoScroll
{
NSLog(@"AutoScroll Started");
if (scrollingTimer == nil) {
scrollingTimer = [NSTimer scheduledTimerWithTimeInterval:(60.0/1000.0)
target:self
selector:@selector(autoscrollTimerFired:)
userInfo:nil
repeats:YES];
}
}
- (void) autoscrollTimerFired:(NSTimer *)timer
{
scrollPoint = self.completeText.contentOffset;
scrollPoint = CGPointMake(scrollPoint.x, scrollPoint.y + velocityFactor);
[self.completeText setContentOffset:scrollPoint animated:NO];
}
如何啓用平滑滾動?謝謝如何在UITextView中啓用平滑滾動?
velocityFactor應該是小和[self.completeText setContentOffset:scrollPoint動畫:是]; //應該是 –
當我設置爲YES的事情變得更糟 –
動畫應該是NO。隨着您所調用的更新速率(大約15 FPS),動畫在平滑度上將沒有什麼區別,並可能導致連續快速調用某些意外行爲。 – Dancreek