Set Grouped table view background colour - uitableview

how can i set the background color of a grouped table view to clear color so that is get the image of the underlying Image View.
i tried to set the view color to clear view in the xib
it works fine in case of a normal table view
but doesnt work for a grouped table view
i also tried it programmatically but in vain
is there any work around

Check this code for clear the background color of grouped table view..
UIView *backView = [[UIView alloc] init];
[backView setBackgroundColor:[UIColor clearColor]];
[yourTableView setBackgroundView:backView];
Thanks..

Related

How to set a background image on a UITableView and have the table view span the full height?

Currently, I am using a UITableViewController. I'm setting a background image on the table view. I have a custom view which contains a segmented control and a search bar that I am setting as the table view header. I'm styling its background to be transparent so that you can see the background image behind it.
Here's what it looks like so far:
However, I would like it to look like this, where the white background color of the table view spans the full height:
How can I achieve this effect?
UIImageView *views = [[UIImageView alloc] initWithFrame:viewFrame];
views.image = [UIImage new];
self.tableView.tableHeaderView = views;
Wouldn't these steps solve your problem ?
remove the tableview background image;
set the tableview background color to white;
add the background image to the table view header instead.

Why is the background of my table view grey when there are no rows?

Why is the background of my table view grey when there are no rows? I can't see where this is set in storyboard
Even setting the background to white explicitly I still get a grey background
Using the defaults for background also results in this grey background:
this might be due to two reason
a) you haven't set data source and delegate and your main view background color is gray
b) cell background color is gray, set that to clear color
Please add this code viewdidload or viewwillappear method
table.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
For me it looks like it is a problem of the UITableViewCells, you should set them to
self.backgroundColor = [UIColor whiteColor]; // or clearColor
then also set the UITableView itself inside the controller to backgroundColor white or grey.
Also the snippet of #Rohitsuvagiya can help to let dissappear the separators if there is no additional UITableViewCell.
Please add line your code in viewdidload or viewillappear
table.backgroundColor=[UIColor clearColor];

setting Transparency to the UITableView

I have a view that contains a scroll view and again that contains a view and then a table view.(this table view has custom cells).
I have a background image for the top most view but the inner most table view background is blocking the image. Tableview shows a white background .
I have to make the background of tableview as transparent so that the image on the view should be visible.
how to do that. Pls help.
Try:
tableView.backgroundView = nil;
tablecell.contentview.backgroundcolor = [UIColor clearColor];
Hope it should help..
You have to set the backgroundview nil before making background as transparent
tableView.backgroundView = nil;
tableView.backgroundColor=[UIColor clearColor];

UITableView FooterView background color to clear color doesnt work

i try to set the UITableView Footerview backgroundcolor to clearColor but it stays white, any
other color works fine, any ideas?
_footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, _incredientsTable.frame.size.width, 60)];
[_footerView setBackgroundColor:[UIColor clearColor]];
Thanks.
Ask yourself these questions:
What do you expect to see through the footer view? Is it the table's background? The underlying view controller's views? In the latter case there are more views between your and the object that you want to be visible under the footer view. That is at least the UITable itself and probably the background of self.view (which in most cases but not all is the table)
You need to set background color of table view in this case.
tblView.backgroundColor = [UIColor clearColor];

How to scroll UITableView background view when scroll the table

I know the UItableView have a property named:backgroundView, but this view not scroll with the table, I want add a background after the table, and can scroll .
How can I do that.
Thanks very much.
You have to set the background image via backgroundColor property of UITableView:
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"background.png"]];

Resources