久久久久久久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 中縮放和捏合)
主站蜘蛛池模板: 一区不卡在线观看 | 亚洲一区二区免费视频 | 久久国产精彩视频 | 日韩精品视频一区二区三区 | 日本一区二区视频 | 精品国产亚洲一区二区三区大结局 | 欧美一级一 | 免费在线观看av网址 | 狠狠操狠狠操 | 91麻豆精品一区二区三区 | 自拍视频一区二区三区 | 色久五月 | 日韩综合一区 | 欧美日韩国产一区二区三区 | 81精品国产乱码久久久久久 | 亚洲视频区 | 日本电影网站 | 精品久久久久久久人人人人传媒 | av在线免费网站 | 日本欧美在线 | 欧美激情精品久久久久久 | 日本欧美国产在线观看 | 夜久久 | 天天插天天干 | 婷婷在线视频 | 男女国产视频 | 亚洲国产精品久久久久婷婷老年 | 日韩午夜影院 | 一级国产精品一级国产精品片 | 亚洲欧美精 | 性一交一乱一伦视频免费观看 | 97人人澡人人爽91综合色 | 精品av | 久久久久久国产精品免费免费 | 亚洲精品国产第一综合99久久 | 婷婷国产一区 | www亚洲成人 | 红桃视频一区二区三区免费 | 久久999| 国产欧美一区二区三区日本久久久 | 香蕉久久网 |