-
-
Save luco/56ddb3b47f45602e812f76a643aa0a3c to your computer and use it in GitHub Desktop.
add this function showNextButton
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RCT_CUSTOM_VIEW_PROPERTY(showNextButton, BOOL, RCTTextField) | |
{ | |
if (json && ([RCTConvert BOOL:json])) { | |
UIToolbar* toolbar = [[UIToolbar alloc] init]; | |
[toolbar sizeToFit]; | |
UIBarButtonItem* flex = [[UIBarButtonItem alloc] | |
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace | |
target:nil action:nil]; | |
UIBarButtonItem* doneButton = [[UIBarButtonItem alloc] | |
initWithTitle:@"Next" style:(UIBarButtonItemStylePlain) | |
target:view action:@selector(endEditing:)]; | |
toolbar.items = @[flex, doneButton]; | |
view.inputAccessoryView = toolbar; | |
} else { | |
view.inputAccessoryView = nil; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment