子视图显示错误 [英] Subview displays wrong

查看:114
本文介绍了子视图显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经制作了一个项目并实施了文件夹项目,现在我已经建立了一个项目显示在图片上的文件夹的子视图。在弹出窗口上有一个图像,我想这样做,如果我点击图像,将显示一个带有整个图像的新控制器。我已经正确设置了......但是,我试图改变子视图等。这个Navigationcontroller永远不会出现在所有层的顶部。它出现在folderviewcontroller中。顺便说一下,Navcontroller是由这个项目建立的: https://github.com/mwaterfall/MWPhotoBrowser并通过以下方式设置Popup: https://github.com/kgn/KGModal

I've made a project and implemented the folder project and now I've set up a subview which is displayed aboce the folder like on the picture. On the popup there's a image and I would like to do it like this that if I tap the image a new controller with the whole image will displayed. I've set up all correctly...However, I tried to change the subview etc. THIS Navigationcontroller never appears at the top of all "layers". it appears in the folderviewcontroller. By the way, the Navcontroller is set up by this project: https://github.com/mwaterfall/MWPhotoBrowser and the Popup was set up through this: 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;
}

图片:
(按钮设置为自定义,所以你看不到它...它有像图像一样的框架)

And the picture: (The button is set to custom so you cant see it...it has the same frame like the image)

推荐答案

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

So this was not finished so I have to awnser my own questions that I didnt found a solution for this.

这篇关于子视图显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆