How to scroll UITableView background view when scroll the table - uitableview

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"]];

Related

tableView background image hides activity indicator

I'm setting the backgroundView of a tableView like this:
self.tableView.backgroundView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:#"background"]];
It works but gets placed on top of the tableview's activity indicator and hides it when the tableview is pulled down for refresh. I've tried setting a breakpoint on the point it's added and confirmed that indeed it goes on top of the activity indicator subviews array. Is there any way to fix this?
Thanks in advance.
I suggest that is better to place UIImageView below your UITableView and set:
_yourTableView.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];

Setting image to tableview background

I have added an imageview on top of tableview. I need to set it to the back of tableview without setting it as a background on tableview.
sendSubviewToBack:bgView also does not work. Can someone help?
try like this ,
if objects are in xib ,then take imageview infront of tableview in xib,
(or)
if you are adding in programatically then add imageview before adding the tableview
(or)
table.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:#""]];
(or)
[table bringSubviewToFront:yourImageview];
Try this
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"table_bg_image.png"]];
Not getting what exactly you want .
One another way from XIB , just simply add it into the xib behind your table View , and set your tableView's background colour as clearcolor, So you'll be able to see the image behind your tableview.

Set Grouped table view background colour

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..

Resources