我在 tableview 上添加了一个 imageview。我需要将其设置为 tableview 的背面,而不将其设置为 tableview 的背景。
sendSubviewToBack:bgView也不起作用。有人可以帮忙吗?
我在 tableview 上添加了一个 imageview。我需要将其设置为 tableview 的背面,而不将其设置为 tableview 的背景。
sendSubviewToBack:bgView也不起作用。有人可以帮忙吗?
试试这样
if objects are in xib ,then take imageview infront of tableview in xib,
(或者)
if you are adding in programatically then add imageview before adding the tableview
(或者)
table.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@""]];
(或者)
[table bringSubviewToFront:yourImageview];
尝试这个
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"table_bg_image.png"]];
没有得到你想要的。另一种来自 XIB 的方法,只需将其添加到 table View 后面的 xib 中,并将 tableView 的背景颜色设置为 clearcolor,这样你就可以看到 tableview 后面的图像。