我试图以模糊方式呈现视图控制器,具有透明背景.我的目标是让呈现和呈现的视图控制器视图同时显示.问题是,当呈现动画结束时,呈现视图控制器的视图消失.
- (IBAction)pushModalViewControllerButtonPressed:(id)sender
{
ModalViewController *modalVC = [[ModalViewController alloc] init];
[self presentViewController:modalVC animated:YES completion:nil];
}
Run Code Online (Sandbox Code Playgroud)
我知道我可以将视图添加为子视图,但出于某种原因我想避免使用此解决方案.我该怎么办呢?
objective-c modalviewcontroller presentmodalviewcontroller ios
我想在viewController上显示一个modalview.(有一个导航控制器).
在我看来,我有文字和一个显示模态视图的按钮.
我创建了一个包含我的模态视图的.xib(它是带有图像和标签的视图).
当我展示它时,那:
ShareController *controller = [[ShareController alloc] initWithNibName:@"ShareController" bundle: nil];
controller.view.backgroundColor = [UIColor clearColor];
controller.modalPresentationStyle = UIModalPresentationFormSheet;
controller.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:controller animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
我有我的模态视图,但是,背景变成了黑色......我想在我的视图中看到文本.(我试图设置alpha等等;但是没有运行:'()
有人帮我吗?
谢谢,