Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIView over UIScrollView prevent it from scrolling

I have a UITableView, Each cell has a view like below image, a UIScrollView in background and another view on the UIScrollView.

UIScrollView contains multiple images and user should be able to see them by swiping right or left on the table cell, But as second View (red area) covered UIScrollview, Scrolling not work when I swipe my finger in this area, But in the top of red area it's ok and works perfect.

enter image description here

I see in the other application that have this feature that scrolling is possible in all cell height even when they have other views that covered the background.

I should be grateful if you share your suggestions with me :)

like image 707
Morteza Soleimani Avatar asked Jul 14 '15 06:07

Morteza Soleimani


People also ask

Can stack view be scrollable?

It's not necessary to combine manual and auto layout to allow for a scrollable stack view. You simply need to constrain the stack view's width and/or height.

How do I make my UI view scrollable?

You cannot make a UIView scrollable. That's what UIScrollView is for. However if you are using storyboards you can try to add constraints to the view so when you rotate the device the content remains inside the viewable area.

What is UI scroll view?

UIScrollView is the superclass of several UIKit classes, including UITableView and UITextView . A scroll view is a view with an origin that's adjustable over the content view. It clips the content to its frame, which generally (but not necessarily) coincides with that of the app's main window.

What is scrollView contentSize?

contentSize is the size of the content within the UIScrollView and how long it can be within scrollView . Sometimes this is dynamic like pagination or static like a contact list. This might be changing at runtime as well. This can be set programmatically as well.


1 Answers

try disable userInteraction on the view in the red area, this will allow touches to pass though it. this can be done through the storyboard, or just go view.userInteractionEnabled = false

like image 86
Fonix Avatar answered Sep 22 '22 23:09

Fonix