uiscrollview

IOS 5: UIScrollView not pass touches to nextResponder

心已入冬 提交于 2019-12-23 17:41:09
问题 I have a subclass of UIScrollView , and override all 4 Touches functions for it. In those Touches functions, [[self nextResponder] Touches...] and [super Touches...] are used to pass the touches events. Also I have a view controller in which I override all 4 Touches functions too. In the Controller, I set the self.view as: self.view = subclass of UIScrollview; Before iOS 5, when there are touches move on the scrollview, the view controller's touch functions can receive all touch begin/move

UIScrollview contentOffset changes when removed from window

。_饼干妹妹 提交于 2019-12-23 16:35:48
问题 I have a weird bug concerning an UIScrollView. This view works fine, until the moment I remove it from the window (indirectly, it's a subview to a removed view). I then perform some unrelated animation ; and when I put the views where they were, the scrollView's contentOffset has changed. I put a breakpoint in setContentOffset: function, and got the following stack : #0 -[TestScrollView setContentOffset:] (self=0x915fbd0, _cmd=0x7fb34cd, contentOffset={x = 80, y = -0}) at /Users/..

UIScrollView and content with requires touch move events

寵の児 提交于 2019-12-23 13:24:41
问题 I have a view which is using single touch events (single finger) for drawing (lines, cycles, text, and so on). Now I want to put this view inside of UIScrollView, which will allow zooming and panning. Of course two fingers are required to perform both zooming and panning. What is the pattern do do that? I've found only examples when contents of UIScrollView accepts only single clicks (it contains only a buttons). Nothing what to do when contents require also touch moves. 回答1: Access the

UIScrollView Setting contentoffset in viewwillappear not working

孤人 提交于 2019-12-23 12:22:13
问题 I was wondering if it is possible to set contentoffset for uiscrollview in viewwillappear method. -(void) viewWillAppear:(BOOL)animated{ [self.scrollView setContentOffset:CGPointMake(320, 0) animated:YES]; NSLog(@"CALLED"); } I can see viewwillappear is running but unfortunately it is not setting offset. Thank you 回答1: you should call [super viewWillAppear:animated]; before attempting to set the offset. However, it is possible you are trying to set the offset too early in the view lifecycle.

scrollViewDidScroll: on UITableViewRowAnimation?

谁都会走 提交于 2019-12-23 12:04:20
问题 When one uses a UITableViewRowAnimation upon deletion of a row or the addition of a row, sometimes if this row is at the extremes of the tableview the table scrolls. Yet, even though it scrolls it doesn't seem to call scrollViewDidScroll: on the delegate. For example, I have the following code in my delegate. - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ NSLog(@"Scrolling %f", scrollView.contentOffset.y); } Which gets called if the user scrolls. But when I have a deletion of a row:

iPhone UIScrollView / setContentOffset weirdness

只谈情不闲聊 提交于 2019-12-23 09:59:07
问题 I have a weird issue with setContentOffset which I don't seem to be able to solve: I'm trying to build an "endless" scroll view, so I'd like to reset the content offset at a certain position. With the code below setContentOffset will be called at x=160px. If I drag the scroll view my log looks like this: offset: 158 offset: 159 offset: 160 offset: 80 offset: 160 What happens is that my setContentOffset (to 80) is performed, when I keep on dragging UIScrollView seem to have forgotten about it

Center contents of UIScrollview when using autolayout

血红的双手。 提交于 2019-12-23 09:29:15
问题 I'm using autolayout in my project and I have a scrollview that has a button centered in it. I have gotten the scrollview to scroll, but not to take up the entire screen. I've tried to follow the tutorial here: https://developer.apple.com/library/ios/technotes/tn2154/_index.html, as well as I have checked out a few similar questions on here. The issue is that I want the contents of the scrollview to center, rather than be pinned to the top/bottom/left/right. Here is my view hierarchy: Could

UITableView stops scrolling when adding new rows

╄→гoц情女王★ 提交于 2019-12-23 07:49:06
问题 I have a UITableView with Cells that have UIImages as main content. The Table View is paginated, so when I'm near the end of the UITableView I make a new Request to the API and insert the new cells (infinit scrolling). The problem is that when the data from the API arrives, and I add them to the table view, the scrolling stops completly. I've tried with [tableview reloadData] and [tableview beginUpdates] [tableview insertRows...] [tableview endUpdates] But the Scrolling animation stops

How to scroll in iOS Simulator on mac book air?

对着背影说爱祢 提交于 2019-12-23 07:27:59
问题 I have a scroll view and and an embed UIImageView. Code is right but I can not scroll in the Simulator likely because I have a trackpad, not a mouse. Or can I? 回答1: You can click the trackpad and drag (as other folks have said), or if you have "Three finger drag" enabled in Trackpad preferences, you can scroll with three fingers. Here's a guide to all of the gestures in the simulator: iOS Simulator User Guide 回答2: You need to enable 3 finger drag: From the Apple menu, choose System

Get current position of animated scrollview

僤鯓⒐⒋嵵緔 提交于 2019-12-23 06:59:20
问题 i got the following problem. i subclassed a uiscrollview which contentOffset is animated by this code: [UIView animateWithDuration:1.0 delay:1.0 options:options animations:^{ self.contentOffset = CGPointMake(label.frame.size.width, 0); } completion:^(BOOL completed) { //some other stuff }]; Now, when the user "willBeginDragging" the scrollview, i want to stop the current animation and set the scrollview.contentoffset to the current position it has in the uianimation. for example, the user