Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Gradient in tableview cell starts at wrong point #202

Open
jevonjcharles opened this issue Aug 29, 2017 · 4 comments
Open

Gradient in tableview cell starts at wrong point #202

jevonjcharles opened this issue Aug 29, 2017 · 4 comments

Comments

@jevonjcharles
Copy link

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.
simulator screen shot aug 29 2017 3 10 34 pm

@Jay-iTechPioneer
Copy link

@Jevon718 i have same issue you find any solution for it ?? if yes then please suggest it

@av089
Copy link

av089 commented Aug 7, 2018

Hello,

Any Solution for this?

@Jay-iTechPioneer
Copy link

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
        
    }
}

}

@koust
Copy link

koust commented Mar 23, 2019

Hello @av089 ,

Can u try inside "layoutSubviews" method?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants