user2273497
user2273497

Reputation: 11

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?

Upvotes: 0

Views: 97

Answers (3)

Balu
Balu

Reputation: 8460

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

Upvotes: 1

iCoder
iCoder

Reputation: 1318

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.

Upvotes: 0

Satheesh
Satheesh

Reputation: 11276

Try this

 self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"table_bg_image.png"]];

Upvotes: 0

Related Questions