【发布时间】:2023-03-11 15:47:01
【问题描述】:
在我的应用程序中,我有一个 tabBarController 和一个 navigationController。我的视图控制器之一是 TableViewController,在导航栏下我添加了一个 uiView 作为视图的子视图,如下所示:
rectangleInfo = [[UIView alloc] initWithFrame:CGRectMake(0,0,[[UIScreen mainScreen] applicationFrame].size.width,26)]; rectangleInfo.autoresizingMask = (UIViewAutoresizingFlexibleWidth); rectangleInfo.backgroundColor = [UIColor darkGrayColor]; [self.view addSubview: rectangleInfo];
当我点击 tableView 中的一个单元格时,我会像这样推送一个 UIViewController:
[feedViewController setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[[self navigationController] presentModalViewController:feedViewController animated:YES];
在我从 tableViewNavigationController 弹出模态视图几次后,rectangleInfo UIView 消失了。
我像这样弹出我的模态视图:
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
[self setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[self dismissModalViewControllerAnimated:YES];
知道为什么我从父视图中删除模式视图后 tableViewController 的子视图 (rectangleInfo) 消失了吗?
提前谢谢你。
【问题讨论】:
标签: iphone uiview model-view-controller