2017-02-27 120 views
0

在app.js我有,離子:隱藏鍵盤笑臉圖標

if (window.cordova && window.cordova.plugins.Keyboard) { 
     cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); 
     cordova.plugins.Keyboard.disableScroll(true); 
    } 

而在我的HTML我有,

<ion-footer-bar keyboard-attach class="bar-stable item-input-inset" style="margin-bottom: 50px; height: 60px; background-color: white;"> 
    <input style="width: 100%;" type="text" placeholder="{{'text_input' | translate}}" ng-model="post.new"/> 
</ion-footer-bar> 

我想隱藏大於5.0時,在Android的笑臉按鈕鍵盤處於活動狀態,我該怎麼辦?我不希望用戶在文本字段中輸入笑臉。

回答

0

一個簡單的黑客就是改變輸入字段的輸入類型到其他東西。 根據我的需要,我改變了輸入類型爲url,它工作。

<ion-footer-bar keyboard-attach class="bar-stable item-input-inset" style="margin-bottom: 50px; height: 60px; background-color: white;"> 
    <input style="width: 100%;" type="url" placeholder="{{'text_input' | translate}}" ng-model="post.new"/> 
</ion-footer-bar> 

希望這有助於..

+0

類型= 「URL」 沒有奏效。請任何其他建議。 –