TVOS - UICollectionView inside scrollview - scrollview doesn't scroll - swift

I have a CollectionView that is inside a contentView within a scrollview.
If I reach the second row of the collectionview that is hidden, the scrollview won't seem to scroll up to show the second row. It could be the focus that's doing this, just not sure how I can handle this.
Thanks!

I fixed the same issue disabling Scrolling Enabled option on particular UICollectionView.
Now when UICollectionViewCell is focused it is scrolling properly.
I Know this is not ideal solution but it seams to me that it's kind of bug.
Scrolling Disabled
Hope this helps. I'm still looking for solution without limitations.

As an improvement to the previous answer by tomaspavlic, if you have a UICollectionView that scrolls horizontally inside of an existing UICollectionViewCell (of a UICollectionView that scrolls vertically), you can implement the following as a part of the parent cell:
- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
{
self.collectionView.scrollEnabled = [context.nextFocusedView isDescendantOfView:self];
}

Related

UITableViewCell StackView Hidden Elements

I have a TableViewCell that has 2 StackViews. One of the StackViews has 3 components and one of which is hidden. By pressing on a button, I want the hidden UIImageView to appear. While my code does this, it does not format it correctly as the height of the TableViewCell does not change, as I would like it to. I have tried calls to sizeToFit(), but I am starting to realize that this will not affect the height of a cell. When the cell leaves the view and comes back, it draws correctly. How can I update the height of the cell when the button is pressed?
After writing out this question, I started to realize that the problem was from the cell's height. After doing a little bit more research I found out that this can be achieved with the
tableView.beginUpdates()
tableView.endUpdates()
I had to create a delegate and add a delegate method to reference back to the ViewController.
Hope this helps someone else!

Unscrollable tableview inside scrollview

I need to make tableview inside scrollview.
So, when I tap to row "didSelectRowAt" called, but when I scroll tableview, start scrolling scrollview.
I use this.
tableView.isScrollEnabled = false
When I scroll everything in scrollview it's okay, but when I tap to the tableview and trying to scroll it doesn't work.
Do you know how can I fixed it?
Thanks in advance
tableView.isScrollEnabled = false is preventing your tableview from scrolling, remove this, to make your tableView scrollable.
And It will be much better if you share some code.

uitableview inside a uiscrollview (scrolling issue)

I have got a uitableview inside of a uiscrollview.
So the uitableview is smaller than the uiscrollview. And when I start to scroll down on the uitableview and it reaches the bottom, I am able to scroll in the uiscrollview.
And it works fairly. But not perfectly.
I would like to make the ux perfect so the scrollview would be kind of an extension (or another section of the uitableview). I don't want to add any section or footerview at the bottom of the tableview.
I was wondering on doing this by implementing something like this:
//
if tableview didscroll to bottom
then scrollview scrolltorect xxx
//
but it would only work if the uitableview was scrolling down.
I am not sure if this would replicate the correct ux behaviour.
Could you guys give me your advice on how to do this?
Thank you and best regards.
I found this very hard and difficult to execute so I changed my UI in order to put the bottom of the interface inside the tableview footer's view. This way the experience of scrolling my app got much smoother.

Implementing a dynamic height on UITableView

I have a UITableView embedded in a UIViewController. The TableViewCells are rows for the user to select something, so when they touch it a checkmark appears, heres where my question comes in:
I dont want the UITableView to scroll in its window, I want the TableView to grow with the items it contains. Do I need to put a scroll view on the UIViewController and then the TableView on that? Or will the ViewController scroll if the content is bigger than the View?
Also, Im not even sure where to start with changing the height dynamically of the UITableView, everywhere I look its about changing the cell heighets dynamically.
Please Help! Thank you!
self.tableView.scrollEnabled=false;
stops the scrolling
self.tableView.frame=CGRectMake(0, 0, (float)width, (float)height);
sets the size of your tableview
But I don't understand why you want to stop tableview scrolling and to scroll the whole view....

prevent tableview from scrolling while scrolling inside a tableviewcell

i've got a tableview. inside this, i have a tableviewcell with a horizontal scrollview inside it.
it works fine, but if i start scrolling horizontal inside a tableviewcell and move a bit up or down, the horizontal scrolling stops and the tableview gets scrolled.
is there a way to prevent the tableview from scrolling while scrolling horizontal inside a tableviewcell?
thanks for all help
try scrollView.canCancelContentTouches = NO
If that doesn't work you may have to do more complicated handling of touch events by subclassing UIScrollView. (Look at touchesBegan:event:, touchesMoved:event:, touchesEnded:event:, touchesCancelled:event:)
you should not put the UIScrollView inside an UITableView. you could show the content of your cell vertically Or show on the details view
UITableView is a subclass of UIScrollView.
Form Apple Documentation.
Important: You should not embed
UIWebView or UITableView objects in
UIScrollView objects. If you do so,
unexpected behavior can result because
touch events for the two objects can
be mixed up and wrongly handled.
More