子视图显示错误

时间:2012-12-08 01:56:51

标签: iphone ios uiview subview

我已经制作了一个项目并实现了folder project,现在我已经设置了一个子视图,它显示在图片上的文件夹中。在弹出窗口上有一个图像,我想这样做,如果我点击图像,将显示一个带有整个图像的新控制器。我已经正确设置了......但是,我试图改变子视图等。这个Navigationcontroller永远不会出现在所有“层”的顶部。它出现在folderviewcontroller中。顺便说一下,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;
}

图片: (该按钮设置为自定义,因此您无法看到它...它具有与图像相同的帧)

enter image description here

1 个答案:

答案 0 :(得分:1)

所以这还没有完成所以我必须回答我自己的问题,我没有找到解决方案。