【问题标题】:UIAlertView asking to access current location wrong orientationUIAlertView 要求访问当前位置错误的方向
【发布时间】:2011-10-21 16:56:28
【问题描述】:

我的应用当前要求用户访问他们当前的位置,因此当应用启动时,它会显示 UIAlertView 请求它。问题是我的应用程序仅设置为纵向模式,但 UIAlertView 以横向显示。我必须旋转手机才能使其正确定向。我在这里错过了什么?

【问题讨论】:

  • “我的应用程序仅设置为纵向模式” ...您可以显示您用于将其设置为仅纵向模式的代码吗?

标签: iphone objective-c ios ipad uialertview


【解决方案1】:

查看这篇文章:

http://iphonedevelopment.blogspot.com/2008/12/more-on-uialertview-and-landscape.html

基本上你可能需要在警报之前尝试这样的事情。

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];

更新:这是一个带有替代解决方案帖子的 SO。

Rotating a UIAlertView

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-02-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-18
    • 2012-06-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多