我正在使用react-native-webview图书馆的Reaction Native.我的代码如下所示:

<SafeAreaView style={backgroundStyle}>
      <WebView
          useWebKit={true}
          scrollEnabled={false}
          hideKeyboardAccessoryView={true}
          keyboardDisplayRequiresUserAction={false}
          nestedScrollEnabled={!useContainer}
          style={[styles.webview, style]}
          {...rest}
          menuItems={[{ key: 'test0001', label: 'Bold Test' }]}
          onCustomMenuSelection={(event) => {
            console.log('hehehe');
          }}
      />
</SafeAreaView>

它可以在iOS = 15上运行,但不能在iOS = 16上运行.我发现原因是UIMenuController已被弃用,我们应该使用UIEditMenuInteraction代替.

对我有什么建议或文档/链接吗?请帮帮我,非常感谢.

P/S:我试着编辑库的原生代码,但看起来Objective-C对我来说太陌生了:(

推荐答案

由我自己解决,并回馈给存储库. https://github.com/react-native-webview/react-native-webview/pull/3272

Objective-c相关问答推荐

Apple Silicon 上的 dispatch_time 计算失败

MKMapView 上的 UIPanGestureRecognizer?

如何使用第一个字符作为部分名称

如何更改 UIButton 的突出显示 colored颜色 ?

如何创建圆形按钮?

AppDelegate、rootViewController 和 presentViewController

将 Objective-C 指针类型NSString *转换为 C 指针类型CFStringRef(又名const struct __CFString *)需要桥接转换

在 Interface Builder 中设计 UITableView 的section header

为什么当我使其处于非活动状态时,弱 IBOutlet NSLayoutConstraint 变为 nil?

如何处理 Xcode 警告没有以前的函数原型......?

我怎样才能拥有一个同时包含图像和文本的 UIBarButtonItem?

与 iOS 6.0 原生 Facebook 集成共享:通过我的应用名称发布?

如何从 Xcode4 生成 UML 图

Objective-C - 何时使用touch

将 NSData 字节转换为 NSString?

在字符串Objective-c中连接字符串

主队列上的 dispatch_sync 与 dispatch_async

iPhone:在 UITextField 上禁用 Auto-Cap/autocorrect 问题

如何判断数组是空还是空?

使用 UINavigationController 在 UIPageViewController 中下推内容