ios - QLPreviewController shows blank page in iOS8 inside UINavigationController, but not independently -
this follow question quicklook/qlpreviewcontroller shows blank page instead of pdf on ios 8 works fine on ios7.
in lastly answer's comments, appears if got nesting qlpreviewcontroller within uinavigationcontroller work ("we add together view, added uinavigationcontroller"), , i'm wondering how done.
this works in ios7, in ios8, can see document when nowadays qlpreviewcontroller independently.
this code works in ios7/8:
qlpreviewcontroller* previewcontroller = [[qlpreviewcontroller alloc] initwithnibname:nil bundle:nil]; previewcontroller.datasource = self; previewcontroller.delegate = self; previewcontroller.modalpresentationstyle = uimodalpresentationfullscreen; [baseviewcontroller presentviewcontroller:previewcontroller animated:no completion:nil;
this code works in ios7 (in ios8 see nav/toolbars, blank screen instead of doc):
qlpreviewcontroller* previewcontroller = [[qlpreviewcontroller alloc] initwithnibname:nil bundle:nil]; previewcontroller.datasource = self; previewcontroller.delegate = self; previewcontroller.modalpresentationstyle = uimodalpresentationfullscreen; uinavigationcontroller* navigationcontroller = [[[uinavigationcontroller alloc] init] autorelease]; [navigationcontroller setviewcontrollers:@[anotherviewcontroller]]; [anotherviewcontroller addchildviewcontroller:previewcontroller]; [anotherviewcontroller.view addsubview:previewcontroller.view]; [baseviewcontroller presentviewcontroller:navigationcontroller animated:no completion:nil;
ios uinavigationcontroller ios8 qlpreviewcontroller
No comments:
Post a Comment