Control over clipping of the tableview footer/section - uitableview

I have defined a footer section view for a tableview that i would like to be wider than my tableview. While i set the clipToBounds property to NO for my tableview my footer section is still being clipped. Is there a way to disable the clipping of the header/footer section for a tableview?

I believe the best approach for this is to have a custom background for your cells that would make them look narrower than the actual table view width.

Related

How to place UILabel exactly below UITableView?

I have UITableView with height of ≤500. Tableview data comes from database. Below UITableView, there is one label and two radio button. The problem is if data in the UITableView is less than its height, then it shows blank space between UITableView and those two radio button. I want to place those label and radio button exactly below tableview. How should I do this ?
This is how my tableview looks
If the table view's height does indeed vary depending on shown content, you could use UITableView's tableFooterView.
For a bit more context see this post for example.
Alternatively you could do this with basic auto-layout by tying your label and radio buttons (that you place as siblings of the table) vertically to the bottom of the table view.
I could also imagine that you may need a section footer. So you may want to have a look at that too.
If you want it to be scrollable, add it as the last row in your table view. You may also go with table view's footer.
If you want it to be sticky at the bottom in case of more rows, go with auto layouts. You may create outlet of table view's height constraint and adjust that accordingly depending on the number of rows. However, this approach is not appreciated.

An extra view appears in cell when pressing reorder dragger, why?

I have an UITableView with varying height, and when pressing reorder control, in the cell view structure a new view appears. Normally it is not a problem, but sometimes its height is quite big, and it overlaps, with cell below.
Why this view appears?
How can I get rid of it?
Or prevent to overlap other cells?
This view is part of the reorder mechanism and can't be removed. It is used to hide the cell content while you drag a screenshot view above the tableview.
If you set the cell clipsToBounds as YES, it should prevent it's content overlapping other cells.

iOS collapsed TableViewCells are transparent

I'm trying to implement a TableView with expandable cells. When a cell is selected I change the height of the cell to show the rest of the content. The problem is that when the cells are collapsed, they are transparent and all of the content is visible through the lower cells. How can I make these cells opaque?
If I understand your problem, it's not that the cell is transparent, it's that the subviews are visible outside the bounds of the cell. You can eliminate that by setting the clipsToBounds property for your cell to YES. You can do that in code, or in IB by selecting the "Clip Subviews" checkbox.

UITableView: scrolling outside bounds hides cells

I have an UITableView that does not fill the whole screen, so there is some space at the top and the bottom of the screen. This table uses table.clipToBounds = NO and table.bounces = YES.
But when scrolling the cells outside the original frame of the table, the cells are hidden. I know that's the normal behavior of UITableView to increase performance. But is it possible to define an area at the top/bottom of UITableView within which the cells are not hidden? Or even set a cell property to be "always" visible?
Subviews outside bounds of superview are hidden (table view's cells are also its subviews). That's just how iOS view hierarchy works, not really about performance. And it doesn't make any sense when a subview/cell is displayed on the screen while user cannot interact with it (because it's out of bounds). In particular, table view reuses cells that go out of its bounds, so no, you cannot set a cell to be "always visible".

iOS: is it possible to make table view header section width bigger than tableview width itself?

Is there a way for a table view header section to have a bigger width then the actual table? Here's a simple picture that shows what I mean:
Basically, I need to make the header section to extend beyond the small table view.
Is it even possible?
Thanks!
What worked for me is subclassing UITableCell and overriding setFrame method.

Resources