0

TVML 的 formTemplate 可以很容易地调整为只允许数字输入:

<formTemplate>
  <textField keyboardType="numberPad">0000</textField>
  <footer>
    <button>
      <text>${TEXT("Submit")}</text>
    </button>
  </footer>
</formTemplate>

这给出了一个类似...的页面

数字键盘

我想进一步减少它,只显示一个“pin entry”屏幕,如下所示: 密码输入

这对 TVML 是否可行,无需托管自己的 UIControl?我在任何地方都没有发现任何关于改变这种风格的说法。知道如何实现这一目标吗?谢谢!

4

2 回答 2

1

使用secure属性textField

https://developer.apple.com/library/tvos/documentation/LanguagesUtilities/Conceptual/ATV_Template_Guide/TVJSAttributes.html#//apple_ref/doc/uid/TP40015064-CH42-SW37

  <textField keyboardType="numberPad" secure="true">0000</textField>
于 2015-12-28T19:33:20.533 回答
0

您指的是 TVDigitEntryViewController。你可以在这里读更多关于它的内容:

https://developer.apple.com/design/human-interface-guidelines/tvos/interface-elements/digit-entry-views/

TVDigitEntryViewController 允许用户在您的应用程序中输入数字(如密码)的视图控制器。

https://developer.apple.com/documentation/tvuikit/tvdigitentryviewcontroller

于 2022-01-20T16:14:43.853 回答