UIScrollView behaves differently after UITableView has been selected - ios

I've been trying to fix this issue all day but can't seem to figure out what's going wrong. I have a UIScrollView which has a UITableView and numerous UITextFields as subviews. When I click the UITextField the UIScrollView will adjust it's contentOffset so the textfield appears above the keyboard. This all works fine until I click on the UITableView and select a cell, after this the UIScrollView performs an extra check and scrolls down about 50 pixels after the first contentOffset change. This is hard to explain so I have attached a video here which demonstrates what happens:
http://tinypic.com/r/14xj6gn/8
Has anyone experienced this or know how to fix it?
Thanks for any help.

Okay, so I found out the reason it happens. If anyone needs help then read this post here:
Disable UIScrollView scrolling when UITextField becomes first responder

Related

Selectable UITableViewCells inside of a UIScrollView

I've been trying to programmatically create a UITableView inside of a UIScrollView and I'm having some trouble. Basically I want to have the cells to register as "checked" when they are tapped on. I don't need the UITableView itself to scroll because the UIScrollView will be large enough that this isn't necessary, but I still need the UIScrollView to be able to scroll when the user drags over the UITableView. I'm just overall confused about how gesture recognition works with regard to this project. I can't get the didSelectRowAtIndexPath method to be called, although I can get the didHighlightRowAt method to work. I saw a suggestion to add a UIScrollView onto each cell, but this didn't seem to help. Any guidance is appreciated as I'm unsure how exactly to go about this.
Thanks!
Sounds to me like you should be using custom UIButtons rather than UITableViewCells to allow for selectable content within your UIScrollView.

UITableview frame changes after scrolling thanks to Autolayout

I'm working on a application where I have a UITableView inside a UIScrollview.
The TableView will display current games players are in, its inside a UIScrollView. I dynamically add cells to the UITableView for each game, but when I scroll the UIScrollView, the tableview inside it snaps back to its size set in the storybuilder.
This is because of autolayout, when I disable it, it doesn't happen anymore. However I do like autolayout for other views in my app. So my question is, how can I fix this problem?
Maybe someone can help me get on the right track.
Thanks
EDIT
I think I must explain my situation more, I will use an image where I can display what is happening
Explanation
Before and after scrolling.
As you can see I use the scrollview because there can be many games, so you'll have to scroll down to see them all. The TableView is just to hold the data, scrolling is disabled on that. After scrolling the TableView that says "JOUW BEURT" snaps back to its size set in the Storybuilder. This is because of auto layout like I said, but I don't know how to fix this.
You shouldn't put a tableview inside a scrollview as a tableview itself contains a scrollview and causes issues just like you are seeing when you have a scrollview inside a scrollview.
Remove the scrollview and this should fix your issue. If you are wanting to put content above the tableview or where you scroll down to view the tableview cells etc, consider adding a tableview header view that is added above the tableview.
Why did you place UITableView inside UIScrollView?
Check below
Check your constraints of UITableView and UIScrollView
Placing UITableView inside UIScrollView is somewhat strange
EDIT
You will just need to remove the scrollview and enable scrolling feature of the tableview. that will fix it
UITableView is already a subclass of
UIScrollView

Why UICollectionView offset changes when keyboard appears

I'm developing an iPad app, that has a horizontal UICollectionView. Each of the cells has a UITextField. When the UITextField becomes first responder, the keyboard automatically comes up, and surprisingly all the cells move upwards.
I haven't implemented any logic for the cells to move upwards. Do you know why?
I haven't found any documentation regarding this, and I'm unable to fix this.
This behaviour is implemented by Apple. The standard UICollectionView takes care for you to scroll to the correct position if a keyboard appears. Why would you want to fix this?

Strange behaviour when scrolling just one time UITableView. Can't scroll anymore

So, I've got an UITableView with a Custom Cell
and this is my View Hierarchy:
So, the last view on the top is part of the Custom Cell.
Now I scroll (just touch up, or scroll a little bit), and I get this new View Hierarchy:
I'm getting a last UIView which is not letting me scroll anymore.
Any clue of what is it?
Thank you very much.
Ok, solved.
It was because of it was an instance of MMDrawerController.

UIImageview animation and UILabel inside UICollectionview disappearing

I'm having problems with an animation inside the UICollectionview cell. When I touch my animation, it disappear. I have a refresh time of 8 seconds and when this time is reached, the animation back to normal. My labels inside the cells are having the same issue. It's weird this behavior because when I use static images, they don't disappear.
Arrived while looking for the answer to this. Faced similar issue. Image animation would stop when clicked on the collectionViewCell.
Not sure what the bug is, but one solution that worked for me, was to disable selection on the CollectionView.
In case, you do not need selection on the collection view, just set allowsSelection to NO for the collection view and the bug will go away.

Resources