Closed LIYONGBIN123456 closed 1 year ago
你可以看一下这个回答https://github.com/fluttercommunity/plus_plugins/issues/870#issuecomment-1200419755
@LIYONGBIN123456 我也遇到这个问题,现在Clone下来自己内部维护,已经修复。
请在
+ (void)share:(NSArray *)shareItems withSubject:(NSString *)subject withController:(UIViewController *)controller atSource:(CGRect)origin toResult:(FlutterResult)result withResult:(BOOL)withResult;
方法中最后PresentViewController 方法加多一个iPad 套入一个UINavigationControllerif ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { UINavigationController *navActivityVC = [[UINavigationController alloc]initWithRootViewController:activityViewController]; navActivityVC.navigationBarHidden = YES; activityViewController.modalPresentationStyle = UIModalPresentationPopover; [controller presentViewController:navActivityVC animated:YES completion:nil]; } else { [controller presentViewController:activityViewController animated:YES completion:nil]; }
在文件的第369行 English: I also encountered this issue. Now I have cloned it and maintain it internally, and have already fixed the issue. Please add an UINavigationController for iPad by wrapping the presentViewController method in the
+ (void)share:(NSArray *)shareItems withSubject:(NSString *)subject withController:(UIViewController *)controller atSource:(CGRect)origin toResult:(FlutterResult)result withResult:(BOOL)withResult;
method. The updated code should look like this:
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { UINavigationController *navActivityVC = [[UINavigationController alloc]initWithRootViewController:activityViewController]; navActivityVC.navigationBarHidden = YES; activityViewController.modalPresentationStyle = UIModalPresentationPopover; [controller presentViewController:navActivityVC animated:YES completion:nil]; } else { [controller presentViewController:activityViewController animated:YES completion:nil]; }
On line 369 of the file...
FLTSharePlusPlugin.txt
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days
Platform
iPad 9代 15.4系统
Plugin
share_plus
Version
6.3.0
Flutter SDK
2.18.4
Steps to reproduce
iPhone能分享,iPad不行
Code Sample
Logs
Flutter Doctor
Checklist before submitting a bug
flutter pub upgrade
flutter clean