uiscrollview

Autolayout is changing UIScrollView's contentOffset on rotation

北慕城南 提交于 2019-12-21 13:03:08
问题 To experiment with autolayout and uiscrollview's I have been using this example which I have edited to include 2 views in the scroll view, I have setup the autolayout constraints to position the views horizontally adjacent with their size set to fill the scroll view frame. UIView *beeView = [[[NSBundle mainBundle] loadNibNamed:@"BeeView" owner:nil options:nil] firstObject]; beeView.translatesAutoresizingMaskIntoConstraints = NO; [self.scrollView addSubview:beeView]; UIView *beeView2 = [[

Add functionality to standard Pan Gesture Recognizer in a UIScrollView

 ̄綄美尐妖づ 提交于 2019-12-21 12:24:59
问题 I am trying to keep track of where a finger is in a UIScrollView . I have subclassed UIScrollView (see below) but unfortunately the gesture recognizer that I am adding is overriding the standard one. As a result I get NSLog(@"Pan") to work but unfortunately the view doesn't scroll anymore. How can I get both gestures recognizers to work at the same time? Thanks. - (void)viewDidLoad:(BOOL)animated { [super viewDidLoad:animated]; UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer

Can UITableView scroll with UICollectionView inside it?

跟風遠走 提交于 2019-12-21 09:28:46
问题 I have the structures below... I wrap two of collection views into tableview One is in tableview header(Collection1), another is in tableview 1st row(Collection2). All the functions are good (Both collection view). just... When I scroll up in Collection2, Collection1 will Not scroll up together, because I'm only scrolling the collectionViews not the tableview. It only scroll together when I scroll in Collection1. Is it possible to make the header view scroll with user just like app store's

Can UITableView scroll with UICollectionView inside it?

此生再无相见时 提交于 2019-12-21 09:28:07
问题 I have the structures below... I wrap two of collection views into tableview One is in tableview header(Collection1), another is in tableview 1st row(Collection2). All the functions are good (Both collection view). just... When I scroll up in Collection2, Collection1 will Not scroll up together, because I'm only scrolling the collectionViews not the tableview. It only scroll together when I scroll in Collection1. Is it possible to make the header view scroll with user just like app store's

How to make a screenshot of all the content of a Scrollview?

那年仲夏 提交于 2019-12-21 09:11:12
问题 I want to create a screenshot of a UIScrollView which should contain the whole content of the scroll view, even that content, which is currently not visible to the user. For that I tried the following two methods: func snapShot(view:UIView) -> UIImage { UIGraphicsBeginImageContextWithOptions(view.bounds.size, true, 0); view.drawViewHierarchyInRect(view.bounds, afterScreenUpdates: true); let image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return image; } func

Is there an easy way to make a horizontally paged UIScrollView wrap around? [duplicate]

◇◆丶佛笑我妖孽 提交于 2019-12-21 06:37:48
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: UIScrollView. Any thoughts on implementing “infinite” scroll/zoom? I notice that in the stocks application, the small graph wraps around, eg: when you get to the end of the scroll view and swipe right again, you go back to the beginning. Before I go ahead and code this myself is there an easy way to do this in the SDK? I can't find any properties or methods that would enable that? I have a paged UIScrollView

Embedding container view into UIScrollView

拜拜、爱过 提交于 2019-12-21 06:03:18
问题 I've been searching high and low to try and figure this out hopefully someone can help (I think this is probably fairly trivial but I'm just over confusing the situation!) I'm using XCode 5 and storyboards. I have a container view which takes up around 75% of the screen space on an iPhone. Above this I have some buttons (and other widgets). I want to be able to load in a view controller into the container when pushing one of the buttons. So far all of this works ok, but the view controllers

Touch events not working on UIViews inside UIScrollView

Deadly 提交于 2019-12-21 05:44:08
问题 I have a series of UIViews inside a UIScrollView, and the UIViewControllers for those views are not receiving the touch events. If I take the views out of the scroll view then it works. I have enabled userInteraction on the views but it's still not working! This must be possible and I'd be really grateful if someone could point me in the right direction! Thanks, Mike 回答1: Do the views have their own touch handlers, or are you relying on the viewcontroller to get the touches? Depending on how

How to zoom a view in UIScrollView with anchor point in center?

房东的猫 提交于 2019-12-21 05:24:13
问题 I have a view in UIScrollView in which the user can zoom into. The view has the same size as the UIScrollView frame. However, the subviews of that view are bigger and centered. It's a container with same size as UIScrollView with centered content. When zooming out, UIScrollView changes the scale of the content with an awkward anchor point to the upper left, rather than a centered one. Is there a way to change this behavior such that when zooming in or out the zoom happens relative to the

Preventing “wrapping” of items in UICollectionView

拟墨画扇 提交于 2019-12-21 04:34:04
问题 I need a UICollectionView to display a grid that is potentially larger than the visible frame in both width and height, while maintaining row and column integrity. The default UICollectionViewFlowLayout allows sections to scroll off-screen, but it wraps items within a section to keep them all on-screen, which screws up my grid. Recognizing that UICollectionView is a subclass of UIScrollView , I tried just manually setting the collection view's content size property in viewDidLoad: self