Created
November 22, 2017 03:24
-
-
Save renso3x/2939df594d8571ccfe23aa9bd70e96d7 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