我已經使用input type =「number」僅顯示數字鍵盤。它在Android中正常工作,但不在iOS中。有沒有其他方法可以做到這一點?顯示iOS中的數字鍵盤問題,Ionic
什麼其實我想要的是一個輸入框,只允許0-9和輸入的最大長度爲1
請讓我知道。提前致謝。
<input type="number" maxlength="1"/>
我已經使用input type =「number」僅顯示數字鍵盤。它在Android中正常工作,但不在iOS中。有沒有其他方法可以做到這一點?顯示iOS中的數字鍵盤問題,Ionic
什麼其實我想要的是一個輸入框,只允許0-9和輸入的最大長度爲1
請讓我知道。提前致謝。
<input type="number" maxlength="1"/>
您可以使用模式:pattern="[0-9]*"
所以:<input type="number" maxlength="1" pattern="[0-9]*" />
<input type="text" pattern="\d*">
或者你可以使用插件 https://market.ionic.io/plugins/ion-digit-keyboard