Setting the scrollable area UISCrollView - uiscrollview

I tryed to use answer it this quiestion Limiting the scrollable area in UIScrollView however i didnt succeed in my problem.
I have a UIScrollView that contains 3 UIView one after another. When I press on the UIView I add a UITableView under UIView i pressed. At this moment I need to limit scrolling area, so I could scroll only this TableView and UIView.At another press on UIView I hide the UITableView and I can scroll further in horizontal direction. My question is - how its possible to implement scrolling only in that area I described? Only thing I know is I have to change contentSize of my UISCrollView, but when I do it I get to the beginning of UIScrollView.

Related

UIScrollview scroll not working

UIScrollview scroll is not working when i tested application in device (iPhone 5), But scroll is working properly in iPhone 5/5s/6/6 Plus simulator. I am developing application using Xcode 6 and UIStoryboard with AutoLayout.
I set the top, bottom, left and right constraints of UIScrollview with relative to Superview. And i also set the constraints of every UIControl which is in the UIScrollview.
Has any one have solution regarding this issue?
Please see below screenshot for reference.
It's probably easiest to have the scroll view contain a single view, which then contains all of your scrollable content. That single view should be anchored to all 4 sides of the scroll view, and if it's only meant to scroll vertically (which is what your screenshot makes it look like), then set the content view to be the same width as the parent of the scroll view.
To make sure an UIScrollView scroll, you have to check
Size
Your content View is bigger than your Scroll View. If you want it to be scrolled vertically, make sure its higher; horizontally, wider.
Constraints
Make sure your Scroll View is pinned to its super view, Top, Bottom, Leading, Trailing.
Make sure your Content view of Scroll View DOES NOT have CenterY constraint set to Scroll View, cause that'd make content view stuck with Scroll View and it'd never be able to scroll. (That happens to me the last time I was stuck)
Interface Builder settings
Make sure the check in Interface Builder under Scroll View is checked:
Scrolling section, Scrolling Enabled.

Display UIImageView contained in UITableViewCell fullscreen with animation when tapped

I've an UIImageView inside an custom UITableViewCell and want it to display fullscreen when I tap on it. I've attached a UITapGestureRecognizer to the UIImageView and the image already resizes. The problem I have right now is that the image only moves inside the cell it is contained in, but it should in fact move out of it. I'd also like to put a black background behind the image.
Any ideas on how to achieve that?
I would say the culprit is most likely either the cell, or the cells content view is clipsToBounds enabled. Setting [cell setClipsToBounds:NO]; should solve this problem.
However, if you're willing to take a new approach to this, it may be beneficial to instead of growing the cells imageView, add a new image above the tableview in the same location as the cell's image view and then grow that. This way you wouldn't have any undesirable behavior like being able to scroll the image view away because the table is still scrollable.

UICollectionView vertical scroll last item

Hi I have a vertical UICollectionView that works just fine, but the las item is barely visible and you have to pan up the scrollview to fully be able to see it, when you stop panning the item bounces back and you can almost interact with it.
I've tried with the bounces properties in the collection view's properties for scrollview in interface builder, but it's still the same.
Should I have to increase "manually" the scrollview's contentsize in order to let me interact with this item?.
You can barely see in the following screenshot, at the bottom just below 25th July
Just a guess here, but maybe your navigation bar is "pushing" your UICollectionView down.
Are you sure the frame of the UICollectionView is right? Maybe it is extended off screen.

UIScrollView can not scroll after add subview to superview

My viewController already have main scrollView for show content as subview in Storyboard. After that i'm try to add new subview for show image gallery (UIScrollView) that also work fine. then when i'm close image gallery view, the main scrollView content size decrease down to fit of the viewController bounds. How can i avoid that situation? Thank you in advance.

detect scroll in horizontally uitableviewCell

I have UiTableView containing some data, and I want to scroll the UiTableViewCells horizontally to the left or right to show some UiButtons that act some action relatif to the content of the cell.
How Can I do this?
I'm thinking in creating custom cell, and putting a scrollView in it, May this did the trick?
There is a tutorial for this at http://idevrecipes.com/2011/04/14/how-does-the-twitter-iphone-app-implement-side-swiping-on-a-table/ with sample code. He is using a UISwipeGestureRecognizer to trigger an animation that pushes the cell off the screen.
You could use a swipe gesture recognizer attached to your cell.
You can add a UIScrollView to the contentView of a UITableViewCell. If you want to scroll the content using buttons, simply overlay the UIScrollView with buttons and make them call the various scrolling methods of UIScrollView.
Nested UIScrollView (UITableView inherits from UIScrollView) are quite clever about detecting touch conflicts and resolving the users intended gesture.
https://github.com/JonasGessner/JGScrollableTableViewCell might be what you're looking for. It implements this using a UIScrollView inside the cell (just like the iOS 7 mail app).
(Yes the answer is a bit late, but it's never too late! :P)

Resources