1 |
.contentInset = UIEdgeInsetsMake(-20, 0, 0, 0) |
标签: swift
swift控制UIView的显示与隐藏
如某someView继承自UIView,可通过设置isHidden属性来控制该view的显示与隐藏
1 2 |
someView.isHidden = true // 隐藏 someView.isHidden = false // 显示 |
iOS-Charts 使用渐变填充
https://github.com/danielgindi/Charts/issues/186
1 2 3 4 5 |
chartDataSet.drawFilledEnabled = true let gradientColors = [UIColor.red.cgColor,UIColor.init(white: 1, alpha: 0).cgColor] let colorLocations:[CGFloat] = [1.0,0.0] let gradient = CGGradient.init(colorsSpace: CGColorSpaceCreateDeviceRGB(), colors: gradientColors as CFArray, locations: colorLocations) chartDataSet.fill = LinearGradientFill(gradient: gradient!,angle: 90) |