1.appdelegate里面 設(shè)置window.rootVC為需要顯示的海報(bào)/廣告vc
LaunchADVC * vc = [[LaunchADVC alloc] init];
BaseNavigationController *vcNav = [[BaseNavigationController alloc] initWithRootViewController:vc];
self.window.rootViewController = vcNav;
2.launchADVC里畫一個(gè)imageview
_adIV = [UIImageView new];
? ? _adIV.contentMode = UIViewContentModeScaleAspectFill;
? ? _adIV.clipsToBounds = YES;
2.1可以海報(bào)未加載出來時(shí),先顯示LaunchScreen里的圖片,這樣就可以使啟動(dòng)圖與海報(bào)無縫銜接.
_placeholderIV = [UIImageView new];
? ? _placeholderIV.contentMode = UIViewContentModeScaleAspectFill;
? ? _placeholderIV.image = [self getLaunchScreenImg];
? ? [self.containerView addSubview:self.placeholderIV];
? ? [self.placeholderIV mas_makeConstraints:^(MASConstraintMaker *make) {
? ? ? ? make.top.left.right.bottom.mas_equalTo(self.containerView).offset(0);
? ? }];
-(UIImage *)getLaunchScreenImg
{
? ? UIViewController * vc = [[UIStoryboard storyboardWithName:@"LaunchScreen" bundle:[NSBundle mainBundle]] instantiateInitialViewController];
? ? CGRect rect = [UIScreen mainScreen].bounds;
? ? UIGraphicsBeginImageContextWithOptions(rect.size, YES, 0.0f);
? ? CGContextRef context = UIGraphicsGetCurrentContext();
? ? vc.view.frame= rect;
? ? [vc.view.layer renderInContext:context];
? ? UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
? ? UIGraphicsEndImageContext();
? ? return image;
}
[self.adIVsd_setImageWithURL:[NSURLURLWithString:resultDict[@"image_url"]]completed:^(UIImage*_Nullableimage,NSError*_Nullableerror,SDImageCacheTypecacheType,NSURL*_NullableimageURL)
?? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? self.placeholderIV.hidden=YES;
? ? ? ? ? ? ? ? ? ? [self->_timerBtnstartTimer:5countDownBlock:^(boolisEnd) {
? ? ? ? ? ? ? ? ? ? ? ? if(isEnd)
? ? ? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? ? ? [selftimerBtnClick];
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? }];
? ? ? ? ? ? ? ? }];
3.后端設(shè)置上傳的圖片尺寸為1240*2208 ? ,要求設(shè)計(jì)圖片的時(shí)候安全區(qū)域居中且尺寸為1100*2000(改尺寸并固定,可增寬增高) ,圖片上需要顯示的內(nèi)容不要超出安全區(qū)域,不然有被裁剪掉的風(fēng)險(xiǎn).