问题
TVML's formTemplate can easily be adapted to only allow numeric input:
<formTemplate>
<textField keyboardType="numberPad">0000</textField>
<footer>
<button>
<text>${TEXT("Submit")}</text>
</button>
</footer>
</formTemplate>
This gives a page like...
I would like to reduce it even further to only display a "pin entry" screen as shown here:
Is this possible with TVML, without hosting an own UIControl? I have nowhere found any mentioning of changing styles like this. Any idea how to achieve this? Thanks!
回答1:
Use secure
attribute in 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>
来源:https://stackoverflow.com/questions/34434312/tvml-how-to-modify-formtemplate-to-show-pin-entry