如何添加在离子软键盘插件下一步按钮 [英] How to add Next button in Ionic soft keyboard plugin
问题描述
我们正在开发采用离子框架android应用。
We are developing the android application using the Ionic framework.
当我们点击我们需要显示下一个按钮,而不是返回按钮输入文本框。在原生的Android API,我们选择以显示下一个按钮。但在离子框架的工作,我们没有选择,显示下一个按钮。
When we click on the input text box we need to show next button instead of the return button. In the native Android API, we have options to show the next button. But in the Ionic frame work we don't have options to show the next button.
我怎么能在软键盘添加下一个按钮,当选择输入文本框字段?
How can I add the next button in the soft keyboard when input text box field is selected?
推荐答案
Next按钮,将不会因为默认情况下出现,离子项目隐藏它。如果需要显示下一个按钮,请使用以下器件ready事件内线。
Next button won't appear because by default, ionic projects hide it.If need to show next button,Use below line inside device ready event.
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
完整code是,
The complete code is,
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
//Comment out this line if you want the next and previous buttons
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
// Set the statusbar to use the default style, tweak this to
// remove the status bar on iOS or change it to use white instead of dark colors.
StatusBar.styleDefault();
}
});
})
这篇关于如何添加在离子软键盘插件下一步按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!