Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 如何将步进器值置于-和+;标志?_Swift_Stepper - Fatal编程技术网

Swift 如何将步进器值置于-和+;标志?

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

我正在通过编程尝试自定义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
        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)

也许你可以在下面找到一些建议: