-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the README to add a section about how to Customize the Toolbar Buttons #256
Update the README to add a section about how to Customize the Toolbar Buttons #256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[ | ||
menuItem, | ||
{ key: menuItem, items: [subItem, subItem]}, | ||
... | ||
] | ||
``` | ||
|
||
#### Customize the Toolbar Buttons | ||
|
||
You can customize the toolbar buttons on the Native UI View component by specifying the toolbar buttons using `setLeftBarButtonItems` and `setRightBarButtonItems`, like so: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick (feel free to ignore):Maybe we could add a sentence on what the second parameter is (the animated
flag) and what it can be used for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather keep this paragraph short. The animated and the view mode parameters are documented in the API here:
Lines 362 to 381 in 04aee96
/** | |
* Set the right bar button items for the specified view mode. | |
* Note: The same button item cannot be added to both the left and right bar button items simultaneously. | |
* | |
* @param items The list of bar button items. See the full list of button items here: https://pspdfkit.com/api/ios/Classes/PSPDFViewController.html#/Toolbar%20button%20items | |
* @param viewMode The optional view mode. Can be 'document', 'thumbnails', 'documentEditor' or `null`. If `null` is passed, bar button items for all view modes are set. | |
* @param animated The animated flag. | |
* | |
* @platform ios | |
*/ | |
setRightBarButtonItems = function(items, viewMode, animated) { | |
if (Platform.OS === "ios") { | |
NativeModules.PSPDFKitViewManager.setRightBarButtonItems( | |
items, | |
viewMode, | |
animated, | |
findNodeHandle(this.refs.pdfView) | |
); | |
} | |
}; |
I will not bump the version numbers on this PR. I'll do it in #255 for both PRs. |
Came up in Z#14836
Details
Updated the README to add a section about how to Customize the Toolbar Buttons.
Acceptance Criteria
package.json
,package-lock.json
, andsamples/Catalog/package.json
(see example commit: 1bf805f).