전체 화면으로 여러 이미지를 표시하는 데 사용하는 클래스 이름을 찾고 있습니다 (App의 미리보기 이미지를 탭하면 iPad의 AppStore-App과 유사 함). 보기의 하단에는 모든 이미지의 작은 미리보기 이미지가있는 막대)입니다.전체 화면으로 여러 이미지 표시
공개 클래스 인 경우 어떻게 호출되며 iPhone에서도 사용할 수 있습니까?
전체 화면으로 여러 이미지를 표시하는 데 사용하는 클래스 이름을 찾고 있습니다 (App의 미리보기 이미지를 탭하면 iPad의 AppStore-App과 유사 함). 보기의 하단에는 모든 이미지의 작은 미리보기 이미지가있는 막대)입니다.전체 화면으로 여러 이미지 표시
공개 클래스 인 경우 어떻게 호출되며 iPhone에서도 사용할 수 있습니까?
좋아, 그럼 난 내 자신을 만들었습니다 ImageFullScreenPresenter
. ImageFullScreenPresenter
을 구축하려는 사람에게 중요한 것은 UIViewController
의 하위 클래스로 만드는 것입니다. 이렇게
PKImageFullScreenPresenter *pkImageFullScreen = [[[PKImageFullScreenPresenter alloc] initWithNibName:@"PKImageFullScreenPresenter" bundle:nil imageArray:myImageArray] autorelease];
AppDelegate *appDel = (AppDelegate *)[UIApplication sharedApplication].delegate;
UIViewController *rootViewController;
if (DEVICE_IS_IPAD) {
//since the splitviewcontroller is the rootviewcontroller on ipad i set it as my temporary rootViewcontroller for ipad
rootViewController = appDel.splitViewController;
}
if (DEVICE_IS_IPHONE) {
//on iphone i need the tabbarcontroller as temporary rootviewcontroller
rootViewController = appDel.tabBarController;
}
//set the alpha to zero, so it can fade in animated
pkImageFullScreen.view.alpha = 0;
//save the temporary rootViewController, so I can set it back when dissmissing the ImageViewController
pkImageFullScreen.superViewController = rootViewController;
//hide the status bar
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
//setting black backgroundcolor
[UIApplication sharedApplication].keyWindow.backgroundColor = [UIColor blackColor];
//init the fullscreencontroller as rootview
[[UIApplication sharedApplication].keyWindow setRootViewController:[[[UINavigationController alloc] initWithRootViewController:pkImageFullScreen] autorelease]];
//smooth fade animation
[UIView animateWithDuration:.5f
animations:^(void){
pkImageFullScreen.view.alpha = 1;
}];
, 내가 아이폰과 아이 패드, 당신은 윈도우 기반 응용 프로그램, 아이 패드 또는 무엇이든에 splitViewController을 사용하는 관계없이에 ImageFullScreenPresenter
을 제공 할 수 있습니다. ImageFullScreenPresenter을 기각 할 때 내가 다시 애니메이션으로 임시 저장 rootViewController 설정 :
- (void)closeView:(id)sender{
[UIView animateWithDuration:.5f
animations:^(void){
self.view.alpha = 0;
}completion:^(BOOL finished){
//show the statusbar again
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
//setting the statusbarstyle
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];
//set the backgroundcolor for the window
[UIApplication sharedApplication].keyWindow.backgroundColor = GLOBAL_TINT_COLOR; //my custom color vor all GUI Objects
//set the temporary rootViewController back
[[UIApplication sharedApplication].keyWindow setRootViewController:superViewController];
//sometimes the navigationbar hides the statusbar, the following two lines help me out
[[UIApplication sharedApplication].keyWindow.rootViewController.navigationController setNavigationBarHidden:YES];
[[UIApplication sharedApplication].keyWindow.rootViewController.navigationController setNavigationBarHidden:NO];
}];
}
나는이 갈 수있는 올바른 방법 인 경우 몰라요, 그러나 그것은 나를 finefor 완벽하게 작동합니다. 나는 이것을 직접 [UIApplication sharedApplication].keyWindow
에 추가 할 때처럼 회전 문제를 걱정할 필요가 없습니다.
시도해 본 다른 사용자가 동일한 목표를 달성하는 데 도움이되기를 바랍니다.
아니요, 직접 제작해야합니다. 그러나 그렇게 어렵지 않아야합니다. – dasdom
나는 그 대답을 두려웠다. 나는 왜 애플이 개발자들이 매우 자주 필요 하긴하지만 그들 자신의 이미지 풀 스크린 프리젠터를 만들길 원하는지 궁금하다. 어쨌든 고마워! – pmk
그들은 게으르기 때문에. ;) 죄송합니다.하지만이 질문이 진짜입니까? 다른 플랫폼에서 응용 프로그램을 빌드 한 적이 있습니까? 대부분의 플랫폼에서 거의 모든 것을 직접 만들어야합니다. iOS 개발에서 사용할 수있는 제품이 너무 많습니다. – dasdom