React Native 中的选择/编辑菜单 [英] Selection/Edit menu in React Native
问题描述
在 iOS 中,可以配置选择和编辑菜单.看起来像这样:
In iOS it's possible to configure a Selection and Edit Menu. That looks like this:
Also, the API is displayed here: https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/AddingCustomEditMenuItems/AddingCustomEditMenuItems.html
这在 React Native 上可行吗?我正在构建一个聊天应用程序,我们需要允许复制消息和自定义菜单项.
So is this possible on React Native? I am building a chat app where we need to allow copying messages and also custom menu items.
推荐答案
在 iOS 上,自定义编辑菜单是通过 UIMenuController
实现的.但是,如果我们查看 react-native 存储库,可以在 RCTTextView 类.
On iOS, customising the edit menu is achieved through UIMenuController
.
However if we look at the react-native repo the only occurrence of that class (until today) can be found in the RCTTextView class.
如果你想将它用于其他组件,你必须自己桥接.
If you want to use it for other components you'll have to bridge it yourself.
这篇关于React Native 中的选择/编辑菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!