chameleon
chameleon copied to clipboard
Gradient in tableview cell starts at wrong point
While using the left to right gradient option the color over laps onto the cell on the left side. I'm not using the accessory for the cell and have even tried changing that color but it still doesn't fix the problem.
@Jevon718 i have same issue you find any solution for it ?? if yes then please suggest it
Hello,
Any Solution for this?
class TableViewCell: UITableViewCell {
@IBOutlet weak var lblplayerName:UILabel!
@IBOutlet weak var lblhowOut:UILabel!
@IBOutlet weak var lblruns:UILabel!
@IBOutlet weak var lblballs:UILabel!
@IBOutlet weak var lbl4s:UILabel!
@IBOutlet weak var lbl6s:UILabel!
@IBOutlet weak var lblSR:UILabel!
@IBOutlet weak var imgCellBg:UIImageView?
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
if let cellbg = self.imgCellBg
{
//set gradient color
var frame = cellbg.frame
frame.size.width = UIScreen.main.bounds.size.width
let gradientColor = GradientColor(.leftToRight, frame: frame, colors: SportColor.gradientColor())
cellbg.backgroundColor = gradientColor
}
}
}
Hello @av089 ,
Can u try inside "layoutSubviews" method?