TableView Cell background on edit not working - ios

I have a tableview with a transparent background, and a content offset to allow part of a background image to be visible at the top of the first cell. The content offset is set with: accordianTableView.contentInset = UIEdgeInsetsMake(100, 0, 0, 0)
As shown in the following image, the green highlighted rectangle is the first cell of the tableview, which has a solid white background. The cell is in edit mode, but there is a transparent section when the cell is dragged to the right, where the background image is visible through the cell even though it has a white background...
I cannot have the background of the table view solid white, since this would cause the background image to be totally invisible through the table view.
How can I make the entire cell background always white, even when dragged to the right while editing?

Worked around the issue by adding an empty UIView behind the tableview, and changing its position to always be behind the tableview - providing a background color for the cells while in edit mode.

Related

Clear TableHeader with ImageView turning white while scrolling [Swift]

Small question when I scroll the tableView, the background color of the header changes to white. I thinks it's a problem with _UIVisualEffectBackdropView, but I didn't know how to resolve that
Without scrolling tableView
When I scroll the tableView

Swift - Empty space when dragging down CollectionView Header

I'm currently building a collection view with a header, I've got all the pieces working, so I don't necessarily have a question/problem about code, header works fine and so do the cells. My question is about the header and when you drag it down, you can see the background color. Currently, I have my header's color set to Gray, and the background color of the controller is set to white, so when I drag the header down, I can see the white background.
My question is.. what code do I need to implement in order for the gray header to be continuously stuck to the top even as I drag the header down?
I'd like to figure how to implement this because I want to keep the spacing of my collection view cells white and not gray (If I were to change the background color to gray).

UITableView cell borders bleed through

I have two groups of cells, we'll call them header cells and body cells. I will always have 4 or less header cells, and 1 or more body cells. The header cells have a colored background (all the same background) and the body cells are all white. The problem is that when I scroll the tableView background color "bleeds through" between cells. This is not a cell divider. The image I attached shows what happens when I set the color to the green that's in the header.
I tried using clearColor for the background, but that shows a black line between all cells, which is not good. So far, we've just given the tableView a white background, since the majority of the cells are white it would be less noticible.
I also tried setting the tableView background color in the cellForRow, depending on the section, but that just causes it to switch what color is popping up, as I thought it would.
How can I get rid of the line that come through when scrolling when the cell background color is different than the tableView background color?

Tableview gets black while data loads from the server

hello I have tableview in which I am populating data from the web service. I am showing activity indicator first on the tableview until data comes from the server. The problem is while spinner is moving table gets black until data comes up and table moves to white color like I designed. But Before that it shows separator lines and black background for like 2 sec. How can I show complete white background with the spinner and also with no separator lines like in many apps.
The black background is most likely the background color of your tableView, because before populating the tableView your reusable cells don't exist in the view. If your tableView has a transparent background the black color is due to the color of the background of your view.
If you want to get rid of the separators just for the loading, I suggest creating a tableFooterView and removing it when populating the tableView.
Not sure what causes the black color from your comment but you can disable separator lines as such:
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone

Background view on UITableViewCell hugs content when using slicing xcassets

I have some very simple UITableViewCells, there is just one one-line UILabel and UIImageView (white arrow). UILabel is anchored to it's parent (content view) top/bottom, the arrow is irrelevant now. When I try to set background view to UIImageView that is loading stretchable image from xcassets, this image view hugs the label which is sizeToFit'ed automatically for some reason.
I have set constraints on both label and background view to anchor them to top/bottom of content view, but they still get small.
The cell's height is 50pt, the label is about 20pt so the difference is quite visible.
Any idea what should I do to have background view fill entire content view?
EDIT:
In following image, you can see 2 cells, one of them in selected state. The bottom cell has both background view and selected background view set. Background view (black one) has no vertical slicing, it's simply image with 50pt height, the Selected background view (the red one) has slicing enabled and it hugs the label vertically.
What I want to achieve is to have slicing enabled for both background and selected background view and having it behave like the non-sliced background view on the image, that is filling entire content view of the cell
EDIT 2:
screenshot of cell layout and constraints set on the imageview that is set as background view on cell
I found related question with answer that helped, so this might be a duplicate.
UITableView - SelectedBackgroundView not working in iOS7 with Auto-Layout
Solution is to create those background view programatically as there is probably yet another bug in interface builder that is screwing this up.

Resources