繁体   English   中英

MWPhotoBrowser-导航栏在iOS 8中消失

[英]MWPhotoBrowser - Navigation Bar disappears in iOS 8

我在我的应用程序中使用MWPhotoBrowser库。 我正在显示照片,字幕,并且一切正常,直到iOS 8出现。

我的问题是;

我可以在iOS 7中看到我的导航栏,但在iOS 8中它消失了,我无法返回。 我检查了gitHub,但找不到任何东西。 你有什么主意吗?

- (void)viewPhotoBrowser{

    self.photos = [NSMutableArray array];

    for (Images *image in self.browserImages) {
        [self.photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:image.image]]];
    }

    // Create & present browser
    self.browser = [[MWPhotoBrowser alloc] initWithDelegate:self];
    // Set options
    self.browser.displayActionButton = YES; // Show action button to allow sharing, copying, etc (defaults to YES)
    self.browser.displayNavArrows = NO; // Whether to display left and right nav arrows on toolbar (defaults to NO)
    self.browser.displaySelectionButtons = NO; // Whether selection buttons are shown on each image (defaults to NO)
    self.browser.zoomPhotosToFill = YES; // Images that almost fill the screen will be initially zoomed to fill (defaults to YES)
    self.browser.alwaysShowControls = NO; // Allows to control whether the bars and controls are always visible or whether they fade away to show the photo full (defaults to NO)
    self.browser.enableGrid = YES; // Whether to allow the viewing of all the photo thumbnails on a grid (defaults to YES)
    self.browser.startOnGrid = NO; // Whether to start on the grid of thumbnails instead of the first photo (defaults to NO)
    self.browser.wantsFullScreenLayout = NO; // iOS 5 & 6 only: Decide if you want the photo browser full screen, i.e. whether the status bar is affected (defaults to YES)

    [self.browser setCurrentPhotoIndex:0]; // Example: allows second image to be presented first

    // Manipulate
    [self.browser showNextPhotoAnimated:YES];
    [self.browser showPreviousPhotoAnimated:YES];

    [self.browser.view setFrame:CGRectMake(0, -20, self.browser.view.frame.size.width, self.browser.view.frame.size.height)];
    [self.view addSubview:self.browser.view];
    [self.navigationController pushViewController:self.browser animated:YES];
}

您必须取消注释该行:

[self.view addSubview:self.browser.view];

此行将导致:MWPhotoBrowser的开始/结束外观转换的不平衡调用。

您已将控制器的视图添加到视图中,然后立即将控制器推入导航堆栈。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM