Non sticky header section cell (supplementaryview) on collectionview - swift

Okay so here is the struggle, the default behavior for header section cells is to stick to the top of the collection view frame, did some digging and couldn't find a way to remove this default behavior, if anyone has clues about how to do it, please share.
The main reason for this is that I want to display a header as a UIView on top of the collectionView so if the section header does not scroll with the rest it kinda sucks in terms of UI experience IMO.

Set the flow layout's sectionHeadersPinToVisibleBounds to false.

Related

Modify the sidebar of UITableView?

my UITableView has a bunch of sections and therefore displays a sidebar, which let's you scroll through the sections.
The problem is: I have a UISearchBar in the header of the UITableView, and the sidebar covers the clear (x) button of the UISearchBar.
Can I modify the sidebar to add margin or at least remove it completely? I couldn't find anything on the sidebar on the Apple Developer site.
Do you have this view made in a xib file is the question?? If you do you should be able to resize the table view to do however big you want it. Here is a link on the apple developer site that has a lot of helpful information about UITableViews and UITableCells:
http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html#//apple_ref/doc/uid/TP40007451-CH7-SW1
The UISearchBar is the headerView of the TableView. I want the strange stuff on the side moved down by the height of the SearchBar, or completely removed.
I figured out, that you can remove the bar with
self.tableView.sectionIndexMinimumDisplayRowCount = 1337;
At least, if you have less than 1337 sections. However, if anyone knows how I access the object which represents the index on the right directly to resize it and move it down, please let me know.
Image of the cause: http://img59.imageshack.us/img59/5397/bildschirmfoto20101121us.png
I think it's a bug in UITableView, so I'm going to report it to Apple.

implementation of collapsing tableView Cells

so I wanted to have a table with multiple sections and each one with multiple cells. By touching a section's header, this section should expand and the others should minimize, leaving only the header visible.
I looked up some suggestions and accomplished this by a) setting the cell's height to 0 and reloding the data animated and b) adding a button as a subview to the cell's header.
Anyway, while it works fine, mainly, there is minor problem, namely, I can see a 'flickering' below each cell's header, when the change is animated. I guess its because the cell's content is redrawn. And I don't like it!
I wanted to ask whether the approach is correct or generally your opinion about it. Moreover I would be really happy, if someone could hint me why the 'flickering' appears in my table :)
EDIT: Another thing is, that if I press on a section, it appears like all the section headers are pressed.... maybe someone has seen this weird artifact also?
You should remove cells instead of setting height to 0.
You will have less call to data source and delegate and no more artifacts.

Left area of section in iPhone TableView

I have a section where I would like to customize the left area of a section a TableView - a bit like viewForHeaderInSection.
I have thought at using a cell for the section instead, but it would be a lot of nitty-gritty.
If I understand your question correctly, you want to customise the left-hand-side of some, or every cell in a UITableView? Then you need to make create your own custom table view cells. I normally make these cells in Interface Builder; this post helped me out. See also the Customizing Cells section of Apple's Table View Programming Guide for iOS.
I read your question to mean that there is one custom element to the left of a bunch of cells. The only way I know of offhand is to use a cell as you describe and then have a left view and a tableview inside of it.

sticky selected cell in UITableView like the new twitter ipad app?

any idea how to have the selected cell in UITableView sticky and remain visible while scrolling? like how the twitter ipad app works. i would like it on my splitview's uitableview.
You are probably using a UITableViewController right? This automatically deselects a selected row. To avoid this, the best option would be to use a normal UIViewController with the protocols UITableViewDelegate and UITableViewDataSource.
Building from a comment Vince made on my previous answer (since deleted since it was more of an explanation of how long and how much effort a feature like this would take rather than an attempt at answering the question).
You could store the index path of a cell when it becomes selected, and then as the cell is about to scroll offscreen (you'll need some trickery to detect this) you could retrieve the cell view returned from cellForRowAtIndexPath and set a section header view to use this cell view.
This would be a pretty monstrous hack though, and you'd need to find a way to elegantly split the table into sections in order to use the section header.
I wouldn't recommend this approach, although its a step in the right direction.

iPhone Recent Calls Details View - Custom Cell?

I would like to have something that would kind of replicate the details view of the recent calls tab on the iPhone phone.app.
When viewing the recent calls, tapping the disclosure button takes me to the view pictured here: http://img337.imageshack.us/img337/3456/recentcalls.jpg
I would like to know if that area in blue represents a custom cell. Am I right? Or is there an easier way to accomplish this?
My need for replicating this comes from my trouble with heightForRowAtIndexPath, as explained here: heightForRowAtIndexPath for only one section?
(I won't be using heightForRowAtIndexPath anymore with this solution).
Thanks in advance.
It looks like the area you've outlined in blue is the section header for the first section. You could also just use the table header.
Matt Gallagher posted a nice article on customizing your table header.
If I had to guess, it is likely a custom section header view, glued together from various labels and other widgets.
It would certainly seem much, much easier IMO to do this with a custom table view header view than with a custom table view cell.
See the table view delegate method -tableView:viewForHeaderInSection: where you return your custom UIView object for a given section.