c# - iOS 模态弹出窗口开始透明但变成空白

标签 c# ios xamarin.ios xamarin ios-simulator

使用 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

这是动画结束后的样子;然而,当动画运行时,它是透明的......知道为什么吗?

最佳答案

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

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

相关文章:

ios - 在 CocoaPod 项目中找不到 ModuleName-Swift.h 文件

objective-c - XCode:为什么我的事件没有被添加到日历中?

iphone - 在iPhone上使用自定义阿拉伯字体时出现问题

xamarin - 当前命名空间中不存在类型或命名空间 'App'

c# - WebResponse/HttpWebResponse 的替代方案

c# - 使用 FindControl() 查找控件

c# - 从 Mac 上的 Rider 附加到 Azure Functions 的调试器

c# - "the term ' 添加迁移 ' is not recognized as the name of a cmdlet" Visual Studio 2019

ios - 按发送后,键盘上键入的文本不会消失

xamarin - 为什么我不能使用iOS设计器创建序列? -Xamarin Studio