如何在UITableView中为部分索引栏设置透明背景?
我试过了:
tableView.sectionIndexBackgroundColor = .clearColor()
但酒吧的背景为浅灰色
编辑
我试图改变tableview的背景颜色,但它似乎没有影响.
tableView.backgroundView = UIView.init() tableView.backgroundColor = .blackColor() // tried .clearColor() too.
EDIT2
tableView.sectionIndexBackgroundColor = UIColor(white: CGFloat(1.0),alpha: CGFloat(0.5)) // change the alpha and check once
我也尝试过使用alpha值的颜色.我可以使背景半透明(参见上面的行代码).但是,如果我将alpha设置为0.0以使其完全透明,我将再次获得浅灰色背景.