fix:新增webViewBounces接口,禁用webview弹性解决分页页面问题

master
jizelin 2021-11-16 21:47:25 +08:00
parent e52609ba67
commit 4ba41676a0
6 changed files with 62 additions and 7 deletions

View File

@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"android":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"mop","dependencies":[]}],"date_created":"2021-09-10 20:41:42.050199","version":"2.2.2"} {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"android":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"mop","dependencies":[]}],"date_created":"2021-11-15 23:44:20.482386","version":"2.2.2"}

View File

@ -87,7 +87,7 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "2.33.15" version: "2.34.5"
path: path:
dependency: transitive dependency: transitive
description: description:

View File

@ -0,0 +1,19 @@
//
// MOP_webViewBounces.h
// mop
//
// Created by beetle_92 on 2021/11/16.
//
#import <Foundation/Foundation.h>
#import "MOPBaseApi.h"
NS_ASSUME_NONNULL_BEGIN
@interface MOP_webViewBounces : MOPBaseApi
@property (nonatomic, assign) BOOL bounces;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,32 @@
//
// MOP_webViewBounces.m
// mop
//
// Created by beetle_92 on 2021/11/16.
//
#import "MOP_webViewBounces.h"
#import "MOPTools.h"
@implementation MOP_webViewBounces
- (void)setupApiWithSuccess:(void (^)(NSDictionary<NSString *,id> * _Nonnull))success failure:(void (^)(id _Nullable))failure cancel:(void (^)(void))cancel {
UIViewController *currentVC = [MOPTools topViewController];
WKWebView *webView = [self searchWKWebView:currentVC.view];
webView.scrollView.bounces = self.bounces;
}
- (WKWebView *)searchWKWebView:(UIView *)view {
for (UIView *subview in view.subviews) {
if ([subview isKindOfClass:[WKWebView class]]) {
return (WKWebView *)subview;
}
WKWebView *webView = [self searchWKWebView:subview];
if (webView) {
return webView;
}
}
return nil;
}
@end

View File

@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk.
s.dependency 'Flutter' s.dependency 'Flutter'
s.ios.deployment_target = '9.0' s.ios.deployment_target = '9.0'
s.dependency 'FinApplet' , '2.34.5' s.dependency 'FinApplet' , '2.35.0-alpha20211116v012'
s.dependency 'FinAppletExt' , '2.34.5' s.dependency 'FinAppletExt' , '2.35.0-alpha20211116v12'
end end

View File

@ -54,9 +54,7 @@ class Mop {
if (handler != null) { if (handler != null) {
return await handler(call.arguments); return await handler(call.arguments);
} }
} else if (call.method.startsWith("extensionApi:")) { } else if (call.method.startsWith("extensionApi:")) {}
}
} }
/// ///
@ -242,4 +240,10 @@ class Mop {
print(data); print(data);
return data; return data;
} }
/// WKWebView
void webViewBounces(bool bounces) async {
await _channel.invokeMapMethod("webViewBounces", {'bounces': bounces});
return;
}
} }