简体   繁体   中英

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

尝试这个

 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM