I have floating headers for my UITableView
(which I want). But it looks quite bad when the suggestion view for the UITextView
in the cell above is under the header.
Seems like no one has had this problem before. Any suggestions?
Both the header cell and UITableViewCell
is loaded from Xib.
The floating header have an alpha on its second topmost view so it's a bit see through.
This is how it looks in "Debug View Hierarchy":
There are two ways that we can add the header and footer, one way is to add it in using Interface Builder and the other way is to do it with code. In this tutorial we will be using both Interface Builder as well as code. The first thing that we need to do is to set up the UITableView and get it to show some data.
UITableView.automaticDimension is what enables AutoLayout to calculate the height of each cell at runtime. estimatedHeaderHeight should be set to a rough estimate of the total height of its content to display the scrolling indicator. These properties can be set in the Size Inspector when selecting the TableView in your storyboard.
Table views are more versatile than you might think. For example, many developers make their life harder using a scroll view when a UITableView would be a better choice. Finally, architecture is crucial for table views.
The cells of UITableView are instances of UITableViewCell or its subclasses. It is the table view that adds, removes, and arranges cells in its view hierarchy. Table views reuse cells that go out of the screen to display new elements, so that:
What if you did something like 'pull' the UITextView out of the table when the user exits it. You could align it over the top and do a nice transition to the editing state perhaps with the table view showing through a blurred overlay or something, but that would allow you to take control of the editing state instead of having it mostly in the hands of the UITableView which was not really designed for multi-line editable cell content.
What if you send that UITextView to the front of the stack?
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/index.html#//apple_ref/occ/instm/UIView/bringSubviewToFront:
I suspect that if it is behind the view below it, that the autocorrect view may also obey the view index of the UITextView.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With