我试图添加一个UIImageView到我的ViewController后,我解雇了一个模态视图控制器。 但由于某种原因[self.view addSubview:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Logo.png"];
未将UIImageView添加到显示器,或者至少不可见。下面是我在模态视图控制器中调用的示例代码。addSubView after dismissViewControllerAnimated
/* 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"];
}
我不太明白你的意思。我对Objective-C非常陌生。 – 2013-03-20 19:31:12
lI已添加修改的方法... – 2013-03-20 19:33:00
好的,谢谢。 – 2013-03-20 19:33:36