-
Notifications
You must be signed in to change notification settings - Fork 227
Open
Description
IOS手机版本 15.0.2
pod.lock部分
- SDWebImage (5.8.3):
- SDWebImage/Core (= 5.8.3)
- GKPhotoBrowser/Core (3.1.6):
- GKPhotoBrowser/Resources
- GKPhotoBrowser/Cover (3.1.6):
- GKPhotoBrowser/Core
- GKPhotoBrowser/Resources (3.1.6)
- GKPhotoBrowser/SD (3.1.6):
- GKPhotoBrowser/Core
- SDWebImage (~> 5.0)
//加载url图片
NSURL *url = [NSURL URLWithString:@"https://www.w3.org/2008/site/images/logo-w3c-mobile-lg.png"];
NSBundle *bundle = [NSBundle bundleForClass:[C4GameSDK class]];
UIImage *bgImage = [UIImage imageNamed:@"C4YGGameSDK.bundle/Image_Browser_Bg" inBundle:bundle compatibleWithTraitCollection:nil];
GKPhoto *photo = [GKPhoto new];
photo.url = url;
GKPhotoBrowser *browser = [GKPhotoBrowser photoBrowserWithPhotos:@[photo] currentIndex:0];
GKPhotoBrowserConfigure *configure = GKPhotoBrowserConfigure.defaultConfig;
configure.showStyle= GKPhotoBrowserHideStyleNone;
configure.hideStyle= GKPhotoBrowserHideStyleZoomScale;
configure.loadStyle= GKPhotoBrowserLoadStyleCustom;
configure.failStyle= GKPhotoBrowserFailStyleCustom;
configure.maxZoomScale = 4;
// 不使用内存缓存
[SDImageCache sharedImageCache].config.shouldCacheImagesInMemory = YES;
UIColor *bgColor = [UIColor colorWithPatternImage:bgImage];
configure.bgColor=bgColor;
browser.view.layer.contents = (id)bgImage.CGImage;
// 指定imageProtocol
[configure setupWebImageProtocol:[[GKSDWebImageManager alloc] init]];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
configure.isFollowSystemRotation = YES;
}
browser.configure = configure;
UIViewController *currentVC = [C4AnalyticsUtils topViewController];
browser.delegate = self;
[browser showFromVC:currentVC];
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels