在我关闭模态视图控制器后,我试图将 UIImageView 添加到我的 ViewController 中。但由于某种原因[self.view addSubview:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Logo.png"];
,没有将 UIImageView 添加到显示中,或者至少它不可见。我在模态视图控制器中调用的示例代码如下。
/* Modal View Controller */
- (IBAction)hideModal:(id)sender {
[self dismissViewControllerAnimated:YES completion:^() {
TestViewController *gv = [self.storyboard instantiateViewControllerWithIdentifier:@"testView"];
[gv view];
[gv addLogo];
}];
}
/* TestViewController */
-(void)addLogo {
[self.view addSubview:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Logo.png"];
}