Can't achieve default UITableView headers sticky behaviour. Already tried plain and group tableview style. Can U please help me with advice in which way I have to dig?
Table view section headers aren't sticky for tvOS. However, sticky headers in collection views work.
Related
I am doing a collapsible header but the header is in a collectionview supplementary header view. How to do the collapsible header and set a specific size when scrolling?
Can you give me any example? or links that could help my question. Thank you
You can refer to see how.
https://medium.com/#mail2ashislaha/stretchy-header-animation-using-collection-view-custom-layout-f2ce466ec710
You should learn about [contentOffset] of [collectionView] before starting.
Good luck.
One way you can achieve this is to have your collapsable header be a separate view that you manage alongside your collectionView using contentOffset/contentInset. This header would be at the same level as the collectionView in the view hierarchy.
As you scroll, you can either shrink or expand the header while defining some min-height and max-height values for it. These values will come in handy when managing the collectionView.
If you want to get even fancier, you can have animations in the header that trigger at certain contentOffset points.
I noticed that when using custom cells in a grouped UITableView, the section headers no longer stay at the top of the view when scrolling down. They just pass out of the view like the rest of the cells. Is there a way to keep the default behavior of the headers while using a custom cell?
grouped style never stays at the top, plain does.
I'm trying to find a way of making the height of a UITableView change depending on how many rows are in the table being displayed.
I've gone through the site for previous questions but none really come to any conclusion.
Language being used is Swift on iOS 8.
Thanks,
Anthony
Use tableFooterView to pin content to the bottom of a UITableView
EDIT:
The tableFooterView (and tableHederView) can be modified directly in Interface Builder by dragging a view below (or above) the prototype cell(s) in your table view.
I wanted to do this within the IB. The way around it was to drag a new view underneath the prototype cell that was already showing in the IB. Then I could change the size to suit my footer content and then just add the footer parts of the layout to that new view within the Table View.
I have a UITableView with one section and a header. The problem is that when I scroll down beyond the contents of the table, the header is pulled down along with the cells. I would like it to stay at the top of the view. I tried the suggestion on this post,
Change Default Scrolling Behavior of UITableView Section Header
using the footer of a zero-row section as the header, but it still isn't anchored. Does anyone know how to do this properly?
Are you using a UITableViewController? If you are using a UIViewController that contains a UITableView you could just add a UIView above the UITableView.
You could also add the UIView on top of the UITableView and add an alpha gradient to make it look more similar to a regular UITableView section header.
I have a UITableView with Headers and Rows. When the Rows scroll up into the Header section it looks like they scroll behind the Header. This is fine except I want both my Header and Rows to have non opaque alpha. The design is translucent. When this is the case you can see the Row scroll behind the Header which is bad. Ideally the row just disappears when it scrolls into the Header section.
Anyone have a solution that will still allow me to use translucent Headers? Thanks!
I had the same issue.
If you only have one header the easy solution I did was to just take the header label out of the tableview and put it in the parent view of the uitableview and just shift the uitableview to compensate for the new header view. Now make the header view transparent and the rows don't scroll behind the header view because it is in a different. The downside is that when you scroll up the header doesn't float above the next cell and obviously it doesn't work for multiple headers. Hope this helps.