StarReview icon indicating copy to clipboard operation
StarReview copied to clipboard

Not work in UITableViewCell

Open uxight opened this issue 9 years ago • 2 comments

I have tried initialize StarReview view in override func awakeFromNib() , required init?(coder aDecoder: NSCoder) but it`s all not work for me. just empty star state initially and when it reload, then finally it appear properly

uxight avatar Jun 19 '16 04:06 uxight

Hello uxight I know this issue. when you initialize StarReview, may be you do not call override init(frame: CGRect) this func. So it appears empty star. please call init(frame: CGRect) func to initialize StarReview or add some code below the func required public init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } please add init(){ super.init(frame: CGRect(x: 0, y: 0, width: 100, height: 30)) //change the size you want self.backgroundColor = UIColor.clearColor() self.userInteractionEnabled = true starRadius = Float(self.frame.size.height) - Float(layer.borderWidth * 2) if ratio < startReviewWidthScale{ starRadius = Float(self.frame.width) / startReviewWidthScale - Float(layer.borderWidth * 2) } } please try this

DuckDeck avatar Jun 19 '16 04:06 DuckDeck

Ok thanks!! Have a good day~

uxight avatar Jun 29 '16 09:06 uxight