Bill Xie 4 gadus atpakaļ
vecāks
revīzija
3c5ebac661
No account linked to committer's email address
2 mainītis faili ar 24 papildinājumiem un 1 dzēšanām
  1. 21
    1
      apple/RNCWebView.m
  2. 3
    0
      apple/RNCWebViewManager.m

+ 21
- 1
apple/RNCWebView.m Parādīt failu

@@ -109,6 +109,9 @@ static NSDictionary* customCertificatesForHost;
109 109
 #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
110 110
   UIScrollViewContentInsetAdjustmentBehavior _savedContentInsetAdjustmentBehavior;
111 111
 #endif
112
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
113
+  BOOL _savedAutomaticallyAdjustsScrollIndicatorInsets;
114
+#endif
112 115
 }
113 116
 
114 117
 - (instancetype)initWithFrame:(CGRect)frame
@@ -140,6 +143,10 @@ static NSDictionary* customCertificatesForHost;
140 143
 #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
141 144
     _savedContentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
142 145
 #endif
146
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
147
+    _savedAutomaticallyAdjustsScrollIndicatorInsets = NO;
148
+#endif
149
+      
143 150
   }
144 151
 
145 152
 #if !TARGET_OS_OSX
@@ -299,6 +306,9 @@ static NSDictionary* customCertificatesForHost;
299 306
       _webView.scrollView.contentInsetAdjustmentBehavior = _savedContentInsetAdjustmentBehavior;
300 307
     }
301 308
 #endif
309
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
310
+    _webView.scrollView.automaticallyAdjustsScrollIndicatorInsets = _savedAutomaticallyAdjustsScrollIndicatorInsets;
311
+#endif
302 312
 
303 313
     [self addSubview:_webView];
304 314
     [self setHideKeyboardAccessoryView: _savedHideKeyboardAccessoryView];
@@ -445,7 +455,17 @@ static NSDictionary* customCertificatesForHost;
445 455
     }
446 456
 }
447 457
 #endif
448
-
458
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
459
+- (void)setAutomaticallyAdjustsScrollIndicatorInsets:(BOOL)automaticallyAdjustsScrollIndicatorInsets{
460
+    _savedAutomaticallyAdjustsScrollIndicatorInsets = automaticallyAdjustsScrollIndicatorInsets;
461
+    if (_webView == nil) {
462
+           return;
463
+       }
464
+       if ([_webView.scrollView respondsToSelector:@selector(setAutomaticallyAdjustsScrollIndicatorInsets:)]) {
465
+           _webView.scrollView.automaticallyAdjustsScrollIndicatorInsets = automaticallyAdjustsScrollIndicatorInsets;
466
+       }
467
+}
468
+#endif
449 469
 /**
450 470
  * This method is called whenever JavaScript running within the web view calls:
451 471
  *   - window.webkit.messageHandlers[MessageHandlerName].postMessage

+ 3
- 0
apple/RNCWebViewManager.m Parādīt failu

@@ -80,6 +80,9 @@ RCT_EXPORT_VIEW_PROPERTY(allowingReadAccessToURL, NSString)
80 80
 #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
81 81
 RCT_EXPORT_VIEW_PROPERTY(contentInsetAdjustmentBehavior, UIScrollViewContentInsetAdjustmentBehavior)
82 82
 #endif
83
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
84
+RCT_EXPORT_VIEW_PROPERTY(automaticallyAdjustsScrollIndicatorInsets, BOOL)
85
+#endif
83 86
 
84 87
 #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* iOS 13 */
85 88
 RCT_EXPORT_VIEW_PROPERTY(contentMode, WKContentMode)