久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

阻止 UITableView 自動滾動

Stop a UITableView from automatically scrolling(阻止 UITableView 自動滾動)
本文介紹了阻止 UITableView 自動滾動的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個使用 setContentOffset 自動滾動的 UITableView.像這樣:

I have a UITableView that I'm autoscrolling with setContentOffset. Like so:

 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];

我想要實現的是滾動平穩地減速和停止.我無法做到這一點.

What I want to achieve is for the scrolling to smoothly slow down and stop. I haven't been able to achieve that.

調用 [self.table.tblMinutes.layer removeAllAnimations] 停止動畫,但由于某種原因移動了 contentOffset,沒有達到我想要的效果.

Calling [self.table.tblMinutes.layer removeAllAnimations] stops the animation, but moves the contentOffset for some reason, not achieving what I want.

我嘗試在動畫中使用 UIViewAnimationOptionBeginFromCurrentState 選項,但沒有任何效果.

I tried using the UIViewAnimationOptionBeginFromCurrentState option in a animation but that did nothing.

有什么建議嗎?

推薦答案

這是中斷現有動畫并將其替換為不同動畫的經典問題的子集.

This is a subset of the classic problem of interrupting an existing animation and replacing it with a different animation.

這里的問題是,如果你僅僅刪除現有的動畫,你會跳到那個動畫的結尾.

The problem here is that if you merely remove the existing animation, you will jump to the end of that animation.

解決方案是在移除現有動畫之前咨詢表示層并將層設置到該位置.現在您從中游開始,可以應用另一個動畫.

The solution to that is to consult the presentation layer and set the layer to that position before removing the existing animation. Now you are starting from midstream and can apply another animation.

這篇關于阻止 UITableView 自動滾動的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

how to set scrollview content size in swift 3.0(如何在 swift 3.0 中設置滾動視圖內容大小)
iOS UIScrollView Lazy Loading(iOS UIScrollView 延遲加載)
using iOS 6.0 SDK and building for iOS 5 Target causes UIScrollView setMinimumZoomScale to fail when running on iOS 5 simulator(在 iOS 5 模擬器上運行時,使用 iOS 6.0 SDK 并為 iOS 5 Target 構建會導致 UIScrollView setMinimumZ
Create partial-screen UIPageViewController programmatically(以編程方式創建部分屏幕 UIPageViewController)
how to make an ImageView zoomable with or without ScrollView.?(如何使用或不使用 ScrollView 使 ImageView 可縮放?)
UIImageView zoom and pinch in UIScrollView(UIImageView 在 UIScrollView 中縮放和捏合)
主站蜘蛛池模板: 日韩视频精品在线 | 欧美精品日韩精品国产精品 | 欧美日韩视频在线 | 国产精品一区二区视频 | 日韩精品视频一区二区三区 | 麻豆精品一区二区三区在线观看 | 久久国产精品偷 | 中文字幕免费中文 | 激情五月婷婷丁香 | 久久亚洲国产精品 | 一区二区免费在线视频 | 欧美不卡一区二区三区 | 欧美亚洲视频在线观看 | 亚洲精品免费视频 | 999国产精品视频 | 欧美a在线 | 日韩福利在线观看 | 国产视频一区二区三区四区五区 | 亚洲视频www | 在线超碰 | 日韩视频一区二区三区 | 乱一性一乱一交一视频a∨ 色爱av | av电影一区二区 | 欧美高清一区 | 蜜臀久久99精品久久久久野外 | 日韩视频一区二区 | 日韩一区精品 | 天天干.com | 亚洲日韩中文字幕一区 | 日韩一级二级片 | 中文字幕电影在线观看 | 国产精品乱码一二三区的特点 | 亚洲视频一区二区三区 | 日韩av成人在线观看 | 最近免费日本视频在线 | 在线视频中文字幕 | 日韩av成人在线观看 | 精品少妇一区二区三区日产乱码 | 午夜精品久久久久久久久久久久久 | 在线观看av网站永久 | 午夜精品一区二区三区在线 |