UITableView limit scrolling speed OR UITableView limit number of rows to be scrolled - iphone

I just saw a brilliant application Nimbuzz. In its chat window, when there are couple of messages and we scroll the UITableView, what appears to be is, scrolling speed is slow. It may sound weird what I just said. You may also consider it this way. On scrolling the table, not much rows are scrolled in comparison to usual scroll behavior.
I am creating an application where I need the similar feature. How to do that?

I think you do that with scrollview's decelerationRate property. Since tableview is subview of scrollview it would work.

Related

Large UITableViewCell stuttering

in my app I have a uiview with a tableview inside of it. This tableview consists of only one cell which is rather high (ca. 750) and contains alot of objects (uitextfields, uitextview, images, buttons, uiscrollview, smaller uitableview, etc).
I'm experiencing a small stuttering when scrolling the tableviewcell which I can't seem to get rid of.
Is it the large amounts of objects in one cell or should I distribute the objects into multiple cells to get rid of the stuttering?
Would be great if somebody has experienced the same issue and could help me out here a little.
Thanks a lot!
I tried this trick with tableHeaderView - works perfect for me! I'm also have a large hierarchy of subviews. ALso if you need some easy custom UI elements appearance/disappearance animations you can divide it into different cells. I love doing like that because of UITextViews and UITextFields - UITableViewController makes layout for keyboard appearance automatically.

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.

Change the 'Gravity' on a UIScrollView with Paging

Is it possible to change the 'gravity' (stop speed) when scrolling through a UIScrollView with paging enabled? I've implemented a horizontal UIScrollView that acts like the UIPickerView. I want to be able to scroll through many items based on the flick speed. Thanks!
Unfortunately there's no simple property you can change to achieve this, but you can use the scrollview delegate methods to roll your own (it is somewhat complex, but achievable - I've modified table views to 'snap' to rows when the scrolling comes to an end).
Effectively, you'll have to code your own paging implementation.

How can we horizontally scroll tableview in iPhone SDK?

I want to scrolltableview horizontally as well as vertically. How can I do it?
I'd suggest making a UIScrollView the same size as the screen and then making your UITableView bigger than the screen.Drop the TableView into the ScrollView. Set up the scrollview with a high contenSize.width and then tweak it to work as you desire.
The idea with embedding UITableView into UIScrollView seems to be great, however there is a serious gotcha. UITableView is optimized to display only visible viewpoirt area and limiting allocated UITableView cells. In the case it is embedded into UIScrollView, it allocates complete content area of scroll view, i.e. all rows for the UITableView. It goes out of the memory for approximatelly 2000 rows. Since the UITableView.reloadData creates callback in main thread, it blocks main thread to respond to didReceiveMemoryWarning and application is killed on system sole discretion for level 2 warning, which is never received.
It seems that the better way is in subclassing UITableView and extending rows to width which can be scrolled horizontally.
If you are looking for something similar to what is done in 'Pulse', then this tutorial might help you:
http://iosstuff.wordpress.com/2011/06/29/creating-pulse-style-scrolling-horizontally-scrolling-uitableview-as-a-subview-of-uitableviewcell/
It shows how to add a horizontally scrolling UITableView to a vertically scrolling UITableView

UITableView as a UIScrollView

I've been working with a UIScrollView and have about 200 items to scroll through...so far. This doesn't work since it takes around 45 seconds to load all of the views. I've tried loading the first 20 (about 4 seconds) on the main thread then load in blocks of 50 on other threads. I get the first 20 to scroll through but the others don't appear.
It's taken lots of effort just to get the UIScrollView to work properly and there are still some issues. The UITableView will solve all of this for me since it reuses cells. It's similar to the UIScrollView except more efficient.
I'd like to have one cell take up the entire viewing area and have the user flick through each cell. Rather than freely scrolling through cells, scrolling will stop at each cell and the user must flick again for the next cell. The UITableView doesn't do this that I know of. Is there a way to get this behavior with a UITableView?
UITableView is a subclass of UIScrollView. Have you tried simply setting yourTableView.pagingEnabled = YES?
Short answer: no.
You can try to control UITableView's scrolling behavior using the delegate methods, or better yet, stick with UIScrollView and load the views one-by-one in the UIScrollViewDelegate methods.