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.
Related
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];
}
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.
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....
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
I have added a pickerView inside a scrollview but when i change the value of picker view it gets scrolled and the value did not get changed.
Please tell me what I should do to prevent scrolling when it is on picker view.
Please help me
Thanks in advance!!
Apple's HIG refuse to put picker view inside a scrollable view. I recommend to put it in a popup view unless the scroll view in scrollable horizontally only.
Add pickerView outside scrollView