【问题标题】:UNTextInputNotificationAction set keybaord to number padUNTextInputNotificationAction 将键盘设置为数字键盘
【发布时间】:2021-05-07 00:12:45
【问题描述】:

我已经在我的 iOS 应用程序的应用程序委托中设置了 UNTextInputNotificationAction,但我无法将键盘更改为数字键盘,它似乎在任何选项中都不可用,但我看到其他应用程序具有这样做了。

这是我的行动

let accept = UNNotificationAction(
identifier: "accept",
title: "Accept")

let add = UNTextInputNotificationAction(
identifier: "add_value",
title: "Add value")

let category = UNNotificationCategory(
identifier: categoryIdentifier,
actions: [accept, add],
intentIdentifiers: [])

UNUserNotificationCenter.current()
  .setNotificationCategories([category])

如何设置通知输入的键盘?

【问题讨论】:

  • 应该输入数字的文本字段叫什么?

标签: ios swift push-notification keyboard


【解决方案1】:

您可以尝试使用 UIKeyboard 类型:阅读更多信息here。你可能会说

textInputPlaceholder.keyboardType = UIKeyboardType.numberPad

【讨论】:

  • 我应该把那行放在哪里?我的问题中的上述几行在didFinisihLaucnhingWithOptions
  • 你可以把它放在你的 viewDidLoad 函数中。
猜你喜欢
  • 1970-01-01
  • 2015-01-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-10-08
相关资源
最近更新 更多