将UIView添加到已经添加到MainView的子视图中

编程入门 行业动态 更新时间:2024-10-22 09:43:16
本文介绍了将UIView添加到已经添加到MainView的子视图中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

结构是这样的..

*)MainView

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

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

Actually I'm doing a iPad App , in one of the UIViewController I've used a UiTableController as a sliding view to pick the Locations . According to locations pick ,need to display UiView's.

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

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 }]; } }

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

I have tried so far , I din't get the solution for it . what is exactly happening here ..? Thanks.

推荐答案

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

may be some other view overlaps that view but i'm not sure try with this method .

[self.ViewLocations bringSubviewToFront:viewname];

更多推荐

将UIView添加到已经添加到MainView的子视图中

本文发布于:2023-11-27 08:10:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637223.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视图   UIView   MainView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!