所以,当我的应用运行时,我的UIActivityViewController
占据了屏幕的一半,当我点击它不会占用的那一半时它会消失然后它会消失我的原始空白ViewController
出现了。
在用户点击其中一个共享选项(例如UIActivityView
或Facebook
)之前,是否可以永久保留Mail
?否则,我只是解决它。
我使用以下命令加载ActivityView:
-(void)viewDidAppear:(BOOL)animated{
UIActivityViewController *controller = [[UIActivityViewController alloc]initWithActivityItems:@[@""] applicationActivities:nil];
[self presentViewController:controller animated:YES completion:nil];
}
答案 0 :(得分:1)
是的,有可能,您可以尝试类似
的内容-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showAViewController) name:@"showAViewController" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dissmissAViewController) name:@"dissmissAViewController" object:nil];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter]removeObserver:self name:@"showAViewController" object:nil];
[[NSNotificationCenter defaultCenter]removeObserver:self name:@"dissmissAViewController" object:nil];
}
-(void)showAViewController{
self.view.userInteractionEnabled=NO;
}
-(void)dissmissAViewController{
self.view.userInteractionEnabled=YES;
}
当您在另一个视图控制器上显示视图控制器时,只需调用
[[NSNotificationCenter defaultCenter] postNotificationName:@"showAViewController" object:nil];
解雇或删除后,只需致电: -
[[NSNotificationCenter defaultCenter] postNotificationName:@"dissmissAViewController" object:nil];