OGeek|极客世界-中国程序员成长平台

标题: c# - iOS 模态弹出窗口开始透明但变为空白 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 11:18
标题: c# - iOS 模态弹出窗口开始透明但变为空白

使用 iOS 模拟器,我试图让模态显示在具有透明背景的父 Controller 上。我将 Controller 定义为:

var controller = new DailyRewardController();

controller.ModalPresentationStyle = UIModalPresentationStyle.CurrentContext;
controller.View.BackgroundColor = UIColor.Clear;
controller.View.Opaque = true;

PresentViewController (controller, true, null);

Controller 最初显示为透明背景,但随着动画结束,屏幕现在是黑色的,如下面的屏幕截图所示。注意:忽略可怕的弹出窗口;它只是一个原型(prototype):-)

enter image description here

这是动画结束后的样子;但是,随着动画的运行,它是透明的……知道为什么吗?



Best Answer-推荐答案


presentviewcontroller 动画完成后 Root View Controller 消失了,这就是原因。

关于c# - iOS 模态弹出窗口开始透明但变为空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25224365/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4