相关疑难解决方法(0)

自定义警报(UIAlertView)与swift

如何使用Swift创建自定义警报?我尝试从Objective c翻译指南但加载全屏布局

为了方便我可以加载透明背景的新布局我试试这个:

    listaalertviewcontroller.view.backgroundColor = UIColor.clearColor()
    let purple = UIColor.purpleColor() // 1.0 alpha
    let semi = purple.colorWithAlphaComponent(0.5)

    listaalertviewcontroller.view.backgroundColor = semi


    presentingViewController.modalPresentationStyle = UIModalPresentationStyle.CurrentContext

    self.presentViewController(listaalertviewcontroller, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)

在动画中它是透明的,但是当动画结束时它是不透明的......我在视图中关闭了不透明的选项......我做错了什么?

uialertview ios swift

17
推荐指数
2
解决办法
3万
查看次数

标签 统计

ios ×1

swift ×1

uialertview ×1