【问题标题】:How to set Alpha to UIView in Storyboard with Xamarin如何使用 Xamarin 在 Storyboard 中将 Alpha 设置为 UIView
【发布时间】:2017-06-19 08:30:52
【问题描述】:

我试着做这个代码。

public override void ViewDidLoad()
    {
        base.ViewDidLoad();

        backGroundView.BackgroundColor = UIColor.LightGray.ColorWithAlpha(0.3f);}

但是它可能不起作用。实际上它显示时看起来像是成功的。

但仅仅一秒钟后,背景颜色就变暗了。

并就同样的问题向我提出建议。

【问题讨论】:

  • 我正在使用 Visual Studio for Mac Preview 3。

标签: c# ios xamarin storyboard


【解决方案1】:

我可以解决这个问题。

我应该在 viewcontroller 方法中写这个。

public override UIModalPresentationStyle ModalPresentationStyle
    {

        get
        {
            return UIModalPresentationStyle.OverCurrentContext;
        }
        set
        {
            base.ModalPresentationStyle = value;
        }
    }

Visual Studio for Mac Preview 3 中的 Storyboard 无法在 Segue 属性中选择 Over Full Screen。这就是我困惑的原因。

【讨论】:

    猜你喜欢
    • 2017-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-29
    • 2018-09-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多