uiscrollview

UIScrollView phantom subviews

元气小坏坏 提交于 2019-12-18 11:53:07
问题 I am loading a view from a nib file using: NSArray *nibViews = [[NSBundle mainBundle] loadNibNamed:@"AnalysisView" owner:self options:nil]; AnalysisView *gridView = [nibViews objectAtIndex: 0]; The nib contains a scrollview called gridScrollView and in the AnalysisView implementation file I have a method which adds views as subviews to the scrollview: for (NSInteger i = [results count] -1; i >= 0; i--) { Result *result = [results objectAtIndex:i]; [self loadResult: result]; } - (void)

UIScrollView phantom subviews

风格不统一 提交于 2019-12-18 11:52:16
问题 I am loading a view from a nib file using: NSArray *nibViews = [[NSBundle mainBundle] loadNibNamed:@"AnalysisView" owner:self options:nil]; AnalysisView *gridView = [nibViews objectAtIndex: 0]; The nib contains a scrollview called gridScrollView and in the AnalysisView implementation file I have a method which adds views as subviews to the scrollview: for (NSInteger i = [results count] -1; i >= 0; i--) { Result *result = [results objectAtIndex:i]; [self loadResult: result]; } - (void)

How to enable zoom for UICollectionView [duplicate]

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 11:51:16
问题 This question already has an answer here : Make UICollectionView zoomable? (1 answer) Closed 5 years ago . I am confused. I have a UICollectionView . I have my own UICollectionViewLayout subclass (iow, I am not using the Flow thing). UICollectionView instance is a subclass of UIScrollView . It adds multiple subviews. But questions like Properly zooming a UIScrollView that contains many subviews seem to say that scrollable views should just have one subview to "scroll the whole view". Seems

UITableView scroll to top when tapping status bar at top of the screen

懵懂的女人 提交于 2019-12-18 10:55:21
问题 I inserted a UITableView inside another UIViewController 's view. but when I tap the status bar at the top of the screen; the table view doesn't scroll to the top which is the expected behavior within iOS apps. I tried : [self.tableView setScrollsToTop:YES]; but the tableview still not scroll to top when tap the top of the screen. 回答1: You have to set scrollsToTop to NO on all the other scroll views in your hierarchy. If more than one scroll view has scrollsToTop set to YES , none of them

Prevent UIScrollView's UIPanGestureRecognizer from blocking UIScreenEdgePanGestureRecognizer

核能气质少年 提交于 2019-12-18 10:55:10
问题 I have a UIScrollView that fills the screen on one page of my app, but I want to allow the user to pan from the edge of the screen to reveal a view behind it. The problem is that the UIScrollView steals the touches from my UIScreenEdgePanGestureRecognizer at the edge of the screen. Unfortunately, I can't access the UIScreenEdgePanGestureRecognizer from the view controller that has the UIScrollView (and vice-versa), so I am not able to use the method requireGestureRecognizerToFail: because I

Prevent UIScrollView's UIPanGestureRecognizer from blocking UIScreenEdgePanGestureRecognizer

ε祈祈猫儿з 提交于 2019-12-18 10:55:03
问题 I have a UIScrollView that fills the screen on one page of my app, but I want to allow the user to pan from the edge of the screen to reveal a view behind it. The problem is that the UIScrollView steals the touches from my UIScreenEdgePanGestureRecognizer at the edge of the screen. Unfortunately, I can't access the UIScreenEdgePanGestureRecognizer from the view controller that has the UIScrollView (and vice-versa), so I am not able to use the method requireGestureRecognizerToFail: because I

How to make a UIScrollView snap to icons (like App Store: Feature)

情到浓时终转凉″ 提交于 2019-12-18 10:46:36
问题 What I want to get is the same behaviour that this scroll view has: I know that this is using HTML and not the native API, but I'm trying to implement it as a UIKit component. Now, to the behaviour I'm looking for: Notice that it's a paged scroll view, but the "page size" is less than the view's width. When you scroll it from left to right each page "snap" to the left-most item. When you scroll it from the right end to the left it "snaps" to the right-most item. The same page but now right-to

Handling touches for nested UIScrollViews scrolling in the same direction

99封情书 提交于 2019-12-18 10:34:10
问题 I have two nested UIScrollViews, both scrolling in the vertical direction. I need the outer scrollview to scroll to it's max range first before allowing the inner scrollview to scroll. The inner scrollview should not be scrollable until the outer scrollview has reached it's max range. Here's an illustration: In the left diagram, a vertical drag inside of Scrollview B should move Scrollview A and Scrollview B should not be scrollable (but it still needs to be able to receive touches/taps).

UITextView content inset

一曲冷凌霜 提交于 2019-12-18 10:31:41
问题 I have encountered something a bit strange with contentInsets I have a UITextView in my storyboard with a contentInset of 50 left, as I'm trying to add some padding to my uitextview However, a scrollbar appears on the bottom of the uitextview, as shown below in this test: I was under the impression that contentInset squashes the uitextview without causing this horizontal scroll bar, so how can I remove the need for the horizontal scrollbar and make everything--the inset AND all the text in

Optimized Image Loading in a UIScrollView

别来无恙 提交于 2019-12-18 09:57:08
问题 I have a UIScrollView that has a set of images loaded side-by-side inside it. You can see an example of my app here: http://www.42restaurants.com. My problem comes in with memory usage. I want to lazy load the images as they are about to appear on the screen and unload images that aren't on screen. As you can see in the code I work out at a minimum which image I need to load and then assign the loading portion to an NSOperation and place it on an NSOperationQueue. Everything works great apart