tjvantoll / nativescript-IQKeyboardManager

NativeScript wrapper for the popular IQKeyboardManager iOS framework
MIT License
100 stars 20 forks source link

Add option to hide the Done button #5

Closed Daxito closed 8 years ago

Daxito commented 8 years ago

It would be nice if we could hide the Done button located at the top of the keyboard, after all, all we want is to make sure the keyboard does not cover the text field.

tjvantoll commented 8 years ago

Hey @Daxito,

You should be able to do that with the following code:

<Page loaded="loaded">
  <TextField id="foo" />
</Page>
exports.loaded = function(args) {
  var page = args.object;
  page.getViewById("foo").ios.inputAccessoryView = UIView.alloc().init();
};

If that doesn’t work for you let me know.

Daxito commented 8 years ago

Yes it worked!!! Thank you so much!

Yamilquery commented 7 years ago

Does not work with Angular 2.

error TS2304: Cannot find name 'UIView'.

:(

mn-martin commented 7 years ago

Quick tip for anyones looking here: If you just want to change the button text you could do something like that in your app.ts file:

declare const IQKeyboardManager: any;
IQKeyboardManager.sharedManager().toolbarDoneBarButtonItemText = "Fertig";
Yamilquery commented 7 years ago

@mn-martin Thank you so much! It worked! 👍

kambl4 commented 5 years ago

How can I do it in nativescript-vue?

dicren commented 4 years ago

How can I do it in nativescript-vue?

If you want remove all the bar

const keyBoardManager = IQKeyboardManager.sharedManager();
keyBoardManager.enableAutoToolbar = false;

If you want to change the button text

const keyBoardManager = IQKeyboardManager.sharedManager();
keyBoardManager.toolbarDoneBarButtonItemText = "all right!";

Not need import anything

BMwanza commented 3 years ago

Thanks @DiCrEn worked for me, using NS Vanilla 🍦