小编lex*_*esk的帖子

是否可以横向旋转UIAlertController(和Alert)?

我正在编辑一个应用程序,我在其中添加了一个新的UIViewController,用于在一个布局中配置多人游戏.

我为每个玩家添加了两个按钮(顶部按钮,机器人按钮).每个按钮在屏幕上生成一个警报(记住它是横向的),但问题是,玩家2看不到警报旋转,我的意思是,警报应该以他的方向显示在我面前.

有没有办法做到这一点?我想为播放器2旋转警报,不会看到警报的信息.

这里有我的警报代码:

@IBAction func ShowAlert(){
let message = "Test"
let alert = UIAlertController(title: title, message: message, preferredStyle: .Alert)

let action = UIAlertAction(title: "OK", style: .Default, handler: nil)

    alert.addAction(action)

    presentViewController(alert, animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)

rotation ios swift uialertcontroller

4
推荐指数
1
解决办法
2314
查看次数

标签 统计

ios ×1

rotation ×1

swift ×1

uialertcontroller ×1