gpt4 book ai didi

ios - 将 UIView 添加到已经添加到 MainView 的 subview

转载 作者:行者123 更新时间:2023-11-29 13:14:01 25 4
gpt4 key购买 nike

结构是这样的,..

*) MainView

     1) viewLocations(UIVIEW) // this one is adding fine

a) viewBangalore
b) viewHyderbad

实际上我正在做一个 iPad 应用程序,在其中一个 UIViewController 中,我使用 UiTableController 作为滑动 View 来选择 Locations 。根据位置选择,需要显示UiView的。

enter image description here

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

}




}

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

最佳答案

可能是其他一些 View 与该 View 重叠,但我不确定是否尝试使用此方法。

[self.ViewLocations bringSubviewToFront:viewname];

关于ios - 将 UIView 添加到已经添加到 MainView 的 subview ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16318003/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com