0

自動スクロールする UITableView がありますsetContentOffset。そのようです:

 CGFloat point = self.table.tblMinutes.contentSize.height - self.table.tblMinutes.bounds.size.height;

    [self.table.tblMinutes setContentOffset:CGPointMake(0, point) animated:false];
    [self.table.tblMinutes layoutIfNeeded];

    [UIView animateWithDuration:20.0 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{
        [self.table.tblMinutes setContentOffset:CGPointMake(0, point - 500) animated:false];
    } completion:nil];

私が達成したいのは、スクロールがスムーズに遅くなり停止することです。私はそれを達成することができませんでした。

呼び出す[self.table.tblMinutes.layer removeAllAnimations]とアニメーションが停止しますが、何らかの理由で contentOffset が移動し、目的が達成されません。

UIViewAnimationOptionBeginFromCurrentStateアニメーションでオプションを使用しようとしましたが、何もしませんでした。

助言がありますか?

4

2 に答える 2

0

UIScrollView については、Kyle Truscott の優れたブログ記事をご覧ください。UITableView は UIScrollView を継承しているため、理論上は機能するはずです。

于 2015-11-17T21:23:11.223 に答える