By default, Ionic will hide the accessory bar on the iOS keyboard (which has a Done button and prev/next buttons to navigate between form inputs). Usually this is a good thing as most native apps don’t have this, but sometimes you can find yourself wanting this feature.
In previous versions of Ionic, it was possible to show the accessory bar by adding the following code inside your $ionicPlatform.ready callback:
However, in Ionic 2, things have changed a little bit. The following code assumes you’re using the native keyboard plugin (if you started a new app using the CLI and –v2 command, you probably are).
Inside your app.component.ts file, you’ll need to import Keyboard from ionic-native. For example:
Then, add Keyboard.hideKeyboardAccessoryBar(false); inside the platform ready promise.
Putting it all together, your app.component.ts file might look something like this:
Comments are closed.
3 comments
Scratch my previous comment – wasn’t working on Ionic View, but emulating makes it show up.
Yeah, Ionic View doesn’t always work as intended. When I was getting started with Ionic a couple years ago I had an issue with playing inline videos in Ionic View. 2 years later the issue hasn’t been resolved: https://github.com/driftyco/ionic-view-issues/issues/126
I think you’re better off avoiding Ionic View altogether and just deploy straight to your device.
Any idea why this would not be working? This is nearly line for line what my code looks like, and in Ionic View I’m still not seeing the accessory bar.