1

我已经创建了一个项目并实现了文件夹项目,现在我已经设置了一个子视图,该子视图显示在图片上的文件夹上方。在弹出窗口中有一个图像,我想这样做,如果我点击图像,将显示一个带有整个图像的新控制器。我已经正确设置了所有...但是,我尝试更改子视图等。此 Navigationcontroller 从未出现在所有“层”的顶部。它出现在文件夹视图控制器中。顺便说一句,Navcontroller 是由这个项目设置的:https ://github.com/mwaterfall/MWPhotoBrowser和 Popup 是通过这个设置的:https ://github.com/kgn/KGModal

所以这是我的代码:

-(IBAction)mehr:(id)sender {

    UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 280, 440)];
cubut = [UIButton buttonWithType:UIButtonTypeCustom];
                                                     [cubut addTarget:self
                                                               action:@selector(dothis:)
                                                     forControlEvents:UIControlEventTouchUpInside];
                                                     [cubut setTitle:@"Show View" forState:UIControlStateNormal];
                                                     cubut.frame = CGRectMake(5, 70, 270, 200);

                                                     [contentView addSubview:cubut];
- (IBAction)dothis:(id)sender {

    MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];

    // Set browser options.
    browser.wantsFullScreenLayout = YES;
    browser.displayActionButton = YES;


    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:browser];

    [self presentModalViewController:navController animated:YES];





    NSMutableArray *photos = [[NSMutableArray alloc] init];
    MWPhoto *photo;
    photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"star" ofType:@"png"]];
    photo.caption = @"The star is soo beateful...";
    [photos addObject:photo];

    self.photos = photos;






}
- (MWPhoto *)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index {
    if (index < _photos.count)
        return [_photos objectAtIndex:index];
    return nil;
}
- (NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser {
    return _photos.count;
}

还有图片:(按钮设置为自定义,所以你看不到它......它与图像具有相同的框架)

在此处输入图像描述

4

1 回答 1

1

所以这还没有完成,所以我不得不提出自己的问题,我没有找到解决方案。

于 2012-12-22T14:03:26.950 回答