繁体   English   中英

向已经添加到MainView的Subview中添加UIView

[英]Adding a UIView's to the Subview which is already added to the MainView

结构是这样的..

*)主视图

  1) viewLocations(UIVIEW) // this one is adding fine a) viewBangalore b) viewHyderbad 

实际上,我正在做一个iPad App,在一个UIViewController中,我已经使用UiTableController作为滑动视图来选择Locations。 根据位置选择,需要显示UiView的。

在此处输入图片说明

viewLocations-> CGRectMake(0,108,588,533)

这里我的代码是:

 if (_detailItem) {
        Location=[_detailItem description];

        if ([Location isEqual:@"Bangalore"]) {
           self.viewLocBangalore= [[UIView alloc] initWithFrame:CGRectMake(10, 10, 500, 400)];
           // self.viewLocBangalore.frame = CGRectMake(10, 10, 500, 400);
            [self.viewLocations addSubview:self.viewLocBangalore];

          [UIView transitionFromView:self.viewLocHyderbad
                                toView:self.viewLocBangalore
                              duration:0.9
                               options:UIViewAnimationOptionTransitionFlipFromBottom

                            completion:^(BOOL finished) {
                                NSLog(@"Locations View Appeared %@", Location);
                            }];

        }

        else if ([Location isEqual:@"Hyderbad"])
        {
            self.viewLocHyderbad.frame = CGRectMake(10, 10, 600, 519);
            [self.viewLocHyderbad removeFromSuperview];
            [self.ViewLocations addSubview:self.viewLocHyderbad];

            [UIView transitionFromView:self.viewLocBangalore
                                toView:self.viewLocHyderbad
                              duration:0.9
                               options:UIViewAnimationOptionTransitionFlipFromBottom

                            completion:^(BOOL finished) {
                                NSLog(@"Locations View Appeared %@", Location); // getting this Log also, but View is missing
                            }];

        }




    }

到目前为止我已经尝试了,但是我找不到解决的办法。 这里到底发生了什么..? 谢谢。

可能是其他视图与该视图重叠,但我不确定尝试使用此方法。

[self.ViewLocations bringSubviewToFront:viewname];

暂无
暂无

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

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