Swift 如何将步进器值置于-和+;标志?
我正在通过编程尝试自定义UIStepper。我想把stepper.value放在-和+按钮之间,我想把stepper的背景改成白色 我该怎么做 以下是我所拥有的不起作用的东西:Swift 如何将步进器值置于-和+;标志?,swift,stepper,Swift,Stepper,我正在通过编程尝试自定义UIStepper。我想把stepper.value放在-和+按钮之间,我想把stepper的背景改成白色 我该怎么做 以下是我所拥有的不起作用的东西: let stepper = UIStepper(frame: CGRect(x: 0, y: 0, width: 200, height: 40)) stepper.minimumValue = 0 stepper.center = self.contentView.center
let stepper = UIStepper(frame: CGRect(x: 0, y: 0, width: 200, height: 40))
stepper.minimumValue = 0
stepper.center = self.contentView.center
stepper.backgroundColor = .white
stepper.layer.backgroundColor = UIColor.white.cgColor
stepper.stepValue = 1
stepper.tintColor = UIColor(hex: Constants.Colors.primary)
stepper.setIncrementImage(UIImage(named: "icon_cart_plus"), for: .normal)
stepper.setDecrementImage(UIImage(named: "icon_cart_minus"), for: .normal)
也许你可以在下面找到一些建议: