Show selected row always while scrolling UITableView? - iphone

Let's say we have a UITableView with some 100 rows, we select a row and after that we scroll the UITableView. The selected row is also scrolled top or bottom direction but I want the selected row to be always visible to the user while scrolling the table. Is it possible ?? please help me out which sample code..(it is same like twitter scrolling)

If you want this, you'll have to write a completely custom tableview from scratch (which I believe was done for Twitter.app). There's no way to do that with the built-in tableview.

Related

Hide rows of a section in a tableview on tap

What is the best way to show and hide rows related to a section on tap?
I have a table view with multiple sections and populated with data
I want to hide the rows when the user press on the section
What is the best practice to achieve that?
Here is maybe the answer to your question. (you can expand and collapse the height of a cell)
Swift: How to animate the rowHeight of a UITableView?

TableView Cells to Fill Screen Swift

I have a dynamically created tableView in XCode which generates cells from an array. Currently, the cells do not fill the entire screen, that's to say that there are empty rows beneath them. How do I get them to fill any screen size for any iOS device at any orientation, please? Also, in another tableview, more array items populate the table - but then I can't scroll to view them all. How do I enable scrolling in a tableview?
So, in summary, how can I get my populated cells to fill the screen of any iOS device? And, how do I enable scrolling?
Thank you very much :) I really need help!
I am unsure of what you are asking because you haven't supplied enough information to determine exactly what task you are attempting to complete. Can you be more specific about what you are trying to do?
I can advise on your request for how to scroll, though. If you want to scroll, you'll have to nest the TableView as a child of a parent ScrollView. You can enable scrolling in the ScrollView, which will then allow you to scroll through the content in the child TableView.

How to implement smooth scrolling using both a UIScrollView and an UITableView?

Is is possible to implement smooth scrolling using both a UIScrollView and placing a UITableView at somewhere starting in the middle of the screen? The UIScrollView contentSize is elongated to accomodate the additional height of the UITableView. The UITableView should be able to contain unlimited and unknown number of rows. Scrolling the entire view downwards will cause the upper non-tableview portion to first disappear and then it scrolls down just like a regular table view.
Put it in another way, I'd like to implement a table with some fixed content before the top row. Think of it like a "header area" for the tables, scrolls up and giving way to the entire table rows.
I probably know that I can implement a TableView and programatically make the first row to contain some fixed images. In this way, it will work as expected. But which is easier to implement?
You really don't want to put the table in a scroll view. When the user scrolls on the table it will not move the underlying scrollview so you won't get the effect you are looking for.
Implement viewForHeaderInSection instead and pass in the view you want to display above the first row, or set tableViewHeader.

How can I make the first and last UITableView cells stay on screen when scrolling?

I have noticed in the iTunesConnect iOS app, the first and last cells of the grouped UITableView stay on screen even though the other cells are scrolling through them. They also move with the tableview. For example when scrolling to the bottom of the table (moving up), the last cell moves up with the table as it leaves the bottom of its position on screen.
Does anyone have an example of how this could be done? I have tried setting the header and footer views but these scroll off screen when moving the tableView.
Thanks.
I think the best approach would be to use a plain UITableView with Header and Footer set, and "skin"/theme your custom UITableViewCells to look like grouped UITableViewCells.
you'd might want to have a look over here for some pointers on how to achieve this.

UITableView add row at top

I have a Uitableview with loading mode like that,
When user scroll to item 5 it'll auto load 10 item and add in the top of label.
My problem is when add like that, current cell move down 10 item, it's bad look.
Can we add cell at top UITableView but current cell not move up or down until user scroll.
What you could do is insert your rows, then use scrollToRowAtIndexPath:atScrollPosition:animated: method to scroll to the row you would like to display. More info here.
Just posted an answer with code snippets here
Keep uitableview static when inserting rows at the top
Basically:
Save the scroll offset where you would have called beginUpdate:.
In place of calls to InsertCell you add the cell's height to the saved offset.
Where you would have called endUpdate:, call reloadData, then scroll by the saved offset with NO animation.