uitableview inside a uiscrollview (scrolling issue) - iphone

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.

Related

UIStackView that responds gestures like UITableView

Question is simple, it is about adding gestures to horizontal stackView that has gestures like tableview. Think of horizontal tableView but also has certain stop points.(Avoiding view to stop any point.) To be more clear, A horizontal working tableView with its gesture features (bouncing, sliding, etc) and has tableViewCell's that has same size of the UIWindow. Finally let's after sliding, it can not stop at a point that reveal's 2 cell's at the same time. I hope it's clear.
Purpose of this making a background to tell people about the app in Login page. I thought stackView would be best for that job but if you have better way, please inform me.
I think you are looking for UIPageViewController instead of using a stackView. A great tutorial can be found here: https://spin.atomicobject.com/2015/12/23/swift-uipageviewcontroller-tutorial/
Im not sure what you mean with "A horizontal working tableView" but if you are looking for a PageViewController that can scroll up and down check this out: https://github.com/stefanceriu/SCPageViewController You can do a lot more with this.

Recreate UIPickerView with just one row showing

I need a "PickerView", that behaves like a normal UIPickerView, but only shows one row of data and has a custom design.
Something like you see in the image, showing the transition from subview 1 to subview 2. After the user lifts his finger and after the scrolling stops, only one subview will be shown:
IMAGE
So basically a scrollview which:
is endless in both, positive and negative directions by showing the same entries over and over
uses paging across several subviews
only shows one subview when not scrolling, and no more than two subviews when scrolling.
I can get a endless scrollview to work, but not with paging enabled. Paging will always limit my scrolling to the next subview.
So I'm thinking about creating my own UIView subclass which custom scrolling behaviour to mimic a UIPickerView. But before doing so, I wanted to get some opinions about the idea in general. Is creating a custom UIView the right way to go? Anyone has some experience with the expected performace? (There will be timers to handle the scrolling algorithm, which has to be recreated of course... :)
Another approach would be to subclass UIScrolView and implement the paging myself. I know when the scrollView starts decelerating
, so maybe there is a way to overwrite the contentOffset to have it scroll into the right position...?!
Any help is appreciated! Thanks!
Here is a great custom component, which seems to be able to do everything you need:
http://dev.doukasd.com/2011/04/infinite-scrolling-dial-control-for-ios/
It's not endless, but rather a modified UITableView with a huge number of cells.
Would it be feasible to just use a UIPickerView, but clipped to the middle row? You could turn off showsSelectionIndicator to remove the overlay and have the delegate pass back custom row views.

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

scrollViewDidScroll not executing

I think have decent experience working with iPhone development.
as much I know.. I did set up the delegate..
I have from top to botton
UIView --> UIScrollView--> UITextView
I tried everything... to get the event scrollView to fire the scrollViewDidScroll event.
is anything wrong with the structure..
there not much of the code to post here.
what I am trying to do is.. do something when UITextView is scrolled.
Sorry did not respond... Just wanted to share in case anyone need this...
I used delegate methods of parent i.e. UIView for UIScrollView i.e. Child it worked..
It's hard to say without some code or a screenshot. Is the scroll view actually scrolling? If you set it up in Interface Builder, did you change the size of the scroll view's contentSize in code so that it can actually scroll? Maybe the text view is eating the scroll events; did you try setting the text view's delegate to see if it's firing a scrollViewDidScroll event?

iPhone: How to Place a Scrollview Inside of Tableview Cell

I want to put a scroll view inside of the table view cell. I have a number of buttons in one cell of table view and I need to scroll that cell to show the appropriate button.
If you want to use a vertical scroll view then I wouldn't suggest you doing it because, as TechZen wrote, there will be a mess in this case.
If you want the inner scroll view to scroll horizontally then it might be achieved by 2 ways:
Implement a custom table view cell that will include a scroll view inside it.
Add a scroll view as a sub-view to your cell that you will return from tableView:cellForRowAtIndexPath: method.
I suggest you to use the second approach.
There are plenty of examples online. Usually the sub-views are labels or image views, but it is not complicated at all to add a scroll view instead...
I don't think you can do this. It would require nesting of scrollviews which isn't really supported.
Even if it was, it would be very difficult for a user to know which scrollview they were hitting with their pudgy finger. Remember, you don't have the one pixel precision of a mouse on the iPhone. You have an area of at least 15x15 pixels. You don't have a scroll bar but instead just drags anywhere on the screen.
Instead, you should use a master-detail pattern. Selecting the cell in the tableview pushes a detail view which has the scroll view with all the buttons.
Why do you want to do it like this?
I think the best idea is to draw your table view manually above your uiscrollview. I did it, and it works. It just takes more effort and drawing accuracy. But that takes a lot of time. :)