I am creating an expandable UITableView. It works fine but the issue I am running into is when a given row is expanded and the user scrolls up, the opened section row scrolls up to the top of the visible table and stick.
In the below image, the detail row material and the succeeding section rows scroll OVER the opened section row.
I would expect that the section row would scroll off the top of the visible table view.
Am I missing something that would allow the section row to scroll up rather than stick?
Related
I have 15 sections with dynamic height sections and rows. By default all sections are closed. After scrolling to end of tableview, I am tapping on last section and it opens properly but when I click again to close section at that time my tableview scroll to top.
This issue occurs when some of the sections are scrolled and after that when click on any visible section.
Please anyone knows what exactly the issue.
I have a static table view with 3 sections and a row in each section.
For each row, I have it setup to be 150 talk in the heightForRowAtIndexPath.
Then on a tap of the row, I have it setup to expand to the height of the device.
All of that works great.
In the expanded row is a textView. When the user selects the textview, the keyboard pops up and pushes the top of the row off screen for a second and then the tableview seems to catch itself and bring it back down to be visible. How can I make sure that it doesnt do that because it looks buggy from the users POV.
I know the title is confusing. So I explain what I expect.
I have 3 sections in my table view. The first section has one or more rows. And second and third sections has only one row. When the first section has more than 4 rows the next sections going to be visible by scrolling table view bottom.
But I need these sections be visible in this case.
Actually I need show these sections at the bottom of the visible frame when first section has more than 4 rows!
Is it possible ?
The thing you can do it to display only the 3 first rows of the first section and then when the user starts scrolling, you add the additional cells to the first section while he is scrolling until you've added all of your cell.
Do the opposite when scrolling to top.
You can use two different TableView instead of one.
declare first TableView with only one section & seconds TableView with two section with one row each.
for that you need to use UIViewController instead of UITableViewController.
in this way your bottom TableView Cell always stay visible while first TableView can scroll with more cells.
I have a UITableView where I have section headers that can be tapped to expand or collapse the section. In my particular example each section only has one row, which is either visible (section expanded) or hidden (section collapsed). (I have a UITapGestureRecognizer on the section headers which I use to expand or collapse the sections) here the process of my actions:
I'm tap on the section (this is UITableViewHeaderFooterView custom view) and i see the cell that appears under the section header. At this moment everything is going OK. But when i scrolling down my tableview, cell goes behind header (like in Contacts application , header is first letter of contact). And finally when i scroll enough to don't see that section with that cell on, and when i scroll up - to return to my display that section - i want to make this section automatically known that when i return(from scrolling away that section from view) to it - i want that section already was closed with 0 cells in it.
Maybe i must use -(void) prepareForReuse at my custom UITableViewHeaderFooterView, or scroll methods ? or any tableView methods?
Thank you
You can implement the scroll view delegate methods and use them to check the scroll position (contentOffset) and / or the visible cells (indexPathsForVisibleRows). Once you know that you can collapse any sections that are no longer visible. You should probably use one of the scroll methods that means the scrolling has stopped (maybe scrollViewDidEndScrollingAnimation:) because changing the table view content size (which changing the number of rows will do) during a scroll animation could cause it to stop abruptly.
I have two section in my UITabelView. My first cell (in first section) represents some caption. Can I have this cell not move when I scroll UITableView, so other content (cells) will scroll but not first.
No, this isn't supported. Everything in a table view scrolls with the table view. The closest thing resembling what you want is section headers in a plain table. The section header stays at the top of screen as the section scrolls but it stays with its section.
Your only option is to use a UIViewController instead of a UITableViewController. Add your caption view to the top and then add your own UITableView below the caption view. You will need to hook everything up so the view controller works like a table view controller.