I am getting results from Google Places Autocomplete and showing them in the collectionView. Default cell color is white, and background is light blue and as I press the searchBar they become gray. Is there a way to change it?
Related
When you enable allowsMultipleSelectionDuringEditing on a UITableView and then enter edit mode on it, each row will display a light grey circle on the left hand side. Upon tapping a row, the circle will be replaced with a tick icon, of the tint colour currently set to the table view.
I'm wondering, is there any way to override the tint colours of both of these icons and control them manually? I've discovered if you set cell.tintColor, you can override the tint colour of the icon when it's checked (But not the hollow circle graphic), but I'd rather be able to change the tint colour of just this icon.
I'm getting the sinking feeling the only way to do this is to manually hack the internal subviews, but I'm hoping someone may have found a way I've missed.
Setting the tintColor property of the cell should be enough.
e.g.
cell.tintColor = .green
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?
I set a transparent image to a UISearchBar in order to show the background of the view behind it. For some reason it caused a strange truncated blue border to appear on the text field.
Here is how it looks:
Any idea from where did it come from? Any way of removing it?
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
My layout places the UISearchController's search bar as a subview of my table view header, alongside other custom controls (buttons, etc.).
In order to make all the controls inside the header view to "blend in", I want to set the header view's background color to match that of the search bar (that is, the outer rim's light gray, not the input textfield's white).
I've tried querying both the search bar's backgroundColor and barTintColor propErties in viewDidLoad(), but both return nil, and my header view ends up white.
I could hard code the color (ColorPicker reports it to be RGB (199, 199, 204), at least on the Simulator), but that's not an elegant solution and will break one day when Apple changes the appearance.
The background for the search bar is actually an image so you cannot retrieve it's background color. However, if you just want it to blend in then you can change the imageView to be transparent and set the background color to anything you wish. The UIImageView was found to be here using the view debugger in Xcode.
In Swift 2.0
(searchBar.subviews[0].subviews[0] as! UIImageView).alpha = 0