小编Vic*_*rcé的帖子

如何在像 Android 这样的警报控制器中编写 Swift 数字选择器

如何创建一个由变量定义的最小值和最大值的数字选择器?

在我的 Android 应用程序中,我创建了一个带有选择器编号的 AlertDialog,并且最大编号链接到我的数据库中的一个值。

是否有可能在 Swift 或接近它的地方做同样的事情?

我的警报控制器代码是:

func createAlertCarte1(Title:String, Message:String) {
        let alertCarte1 = UIAlertController(title: Title, message: Message, preferredStyle: UIAlertController.Style.alert)
        alertCarte1.addAction(UIAlertAction.init(title: "Ok", style: UIAlertAction.Style.default, handler: { (action1) in
            alertCarte1.dismiss(animated: true, completion: nil)
            self.displayAd()
        }))
        alertCarte1.addAction(UIAlertAction.init(title: "Annuler", style: UIAlertAction.Style.cancel, handler: { (action1) in
            alertCarte1.dismiss(animated: true, completion: nil)
        }))

        self.present(alertCarte1, animated: true, completion: nil)

    }
Run Code Online (Sandbox Code Playgroud)

xcode numberpicker swift uialertcontroller

1
推荐指数
1
解决办法
1394
查看次数

标签 统计

numberpicker ×1

swift ×1

uialertcontroller ×1

xcode ×1