Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird bug with in swift? #37

Open
ytpm opened this issue Feb 16, 2019 · 0 comments
Open

Weird bug with in swift? #37

ytpm opened this issue Feb 16, 2019 · 0 comments

Comments

@ytpm
Copy link

ytpm commented Feb 16, 2019

Hey,

I'm trying to use this library with swift, but for some reason I get this weird double drawing of numbers.. what could be the problem? someone knows?

https://imgur.com/xVrVBp3

I've added the WMGaugeView as a subview to UIView which sits inside a custom table cell. This is my code:

cell.gaugeView = WMGaugeView(frame: cell.gaugeContainerView.bounds)
cell.gaugeView?.backgroundColor = UIColor.clear
cell.gaugeView?.showScaleShadow = false
cell.gaugeView?.innerBackgroundStyle = WMGaugeViewInnerBackgroundStyleFlat
cell.gaugeView?.scalesubdivisionsaligment = WMGaugeViewSubdivisionsAlignmentCenter
cell.gaugeView?.needleScrewStyle = WMGaugeViewNeedleScrewStylePlain
cell.gaugeView!.minValue = -30
cell.gaugeView!.maxValue = 30
cell.gaugeView!.showRangeLabels = true
cell.gaugeView!.rangeValues = [10, 20, 30]
cell.gaugeView!.rangeColors = [UIColor(red: 27.0/255.0, green: 202.0/255.0, blue: 33.0/255.0, alpha: 1.0), UIColor(red: 232.0/255.0, green: 111.0/255.0, blue: 33.0/255.0, alpha: 1.0), UIColor(red: 231.0/255.0, green: 32.0/255.0, blue: 43.0/255.0, alpha: 1.0)]
cell.gaugeView!.rangeLabels = ["SAFE FREEZER ZONE", "HIGH", "DANGER ZONE"]
cell.gaugeView!.unitOfMeasurement = "temp"
cell.gaugeView!.showUnitOfMeasurement = true
cell.gaugeView!.scaleDivisionsWidth = 0.008
cell.gaugeView!.scaleSubdivisionsWidth = 0.006
cell.gaugeView!.rangeLabelsFontColor = UIColor.black
cell.gaugeView!.rangeLabelsWidth = 0.04
cell.gaugeView!.rangeLabelsFont = UIFont(name: "Helvetica", size: 0.04)
cell.gaugeView!.setValue(Float(item.temperature!), animated: true, duration: 5.0)
cell.gaugeContainerView.addSubview(cell.gaugeView!)

Thanks

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

No branches or pull requests

1 participant