如何在Ionic软键盘插件中添加Next按钮

gan*_*ran 7 android hybrid-mobile-app ionic-framework ionic

我们正在使用Ionic框架开发android应用程序.

当我们点击输入文本框时,我们需要显示下一个按钮而不是返回按钮.在原生Android API中,我们可以选择显示下一个按钮.但在Ionic框架工作中,我们没有显示下一个按钮的选项.

如果选择输入文本框字段,如何在软键盘中添加下一个按钮?

Muh*_*sin 1

下一个按钮不会出现,因为默认情况下,离子项目隐藏它。如果需要显示下一个按钮,请在设备就绪事件中使用下面的行。

cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
Run Code Online (Sandbox Code Playgroud)

完整的代码是,

.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();
    }
  });
})
Run Code Online (Sandbox Code Playgroud)

  • 不幸的是,下一个按钮仍然没有出现,代码行为“cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);”。为什么? (2认同)