[英]How to make the tableview cell that has been selected to no color as Vine App
如何使已选择为Vine App的无颜色的Tableview单元格。
我已经尝试过了,但是颜色清晰,但是被选中时该单元变白了
藤蔓示例,背景颜色不变https://vid.me/tfkk
我的项目:即使将其设置为clearColor,单元格颜色也会更改https://vid.me/awCq
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! DiscvoerTVC
let colorView = UIView()
colorView.backgroundColor = nil
UITableViewCell.appearance().selectedBackgroundView = colorView
if indexPath.row == 0 {
cell.DiscoverViewColor.backgroundColor = UIColor.grayColor()
cell.DiscoverViewLabel.text = "USMLE CK"
cell.backgroundColor = UIColor.grayColor()
cell.layer.cornerRadius = 20.0
cell.layer.masksToBounds = true
let colorView = UIView()
colorView.backgroundColor = nil
UITableViewCell.appearance().selectedBackgroundView = colorView
}
您是说单元格的选择风格? 如果是这样,请将其选择样式设置为无
cell.selectionStyle = .None;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.