English 中文(简体)
缩略语 ViewDidEndDragging
原标题:UITableView scroll to a specific point when scrollViewDidEndDragging

页: 1 当用户浏览<编码>可调取的<<>可调用的<>密码>时,一定数额,然后释放他们的inger,而不是把 s发回顶,我想把50个点从顶点上排出来,实际上使屏幕顶和顶层之间的50个点相差。

目前,我已经实施了<条码> 编码>,但我不知道如何确定这些意见将回头去。

我尝试了以下几个方面,但并没有按要求开展工作。

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
    // If scrolled over 100 points
    if(-100 > (double)self.tableView.contentOffset.y) {
        [self.tableView setContentOffset:CGPointMake(0, -50) animated:YES];
    }
}

The code above causes a weird flicker, like the animations are both running concurrently, but I m unsure.

希望得到任何帮助。

UPDATE with more information

I m implementing "Pull down to refresh" functionality based upon this post: https://stackoverflow.com/a/6392145/120615

I ve added an extra UIView to the top of the UITableView and when you scroll the UITableView, the UIView moves down into view. When you release your finger from the screen, the UITableView scrolls back to the top hiding the new UIView I ve added.

我将做些什么? UITableView scrolls re to high but ends 100 points from the Superior (so I can show an activity index to theuser) and then after 2/3 seconds scrolls full to the Superior.

问题回答

我认为,你是正确的,由于气概有减速的特征,所以正在同时进行。

不是利用DidEndDraging呼救功能,而是尝试:

  • (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView

只有在用户引发的估算完成后,才会要求这样做。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签