【问题标题】:What's the iPad User Agent of iPhone App when emulated in iPad in UIWebView在 UIWebView 中的 iPad 中模拟 iPhone App 的 iPad 用户代理是什么
【发布时间】:2013-07-23 14:24:12
【问题描述】:

运行带有 UIWebView 的 iPhone 应用程序的 iPad 用户代理将使用 iPad 用户代理还是 iPhone 用户代理?

【问题讨论】:

    标签: iphone ipad uiwebview


    【解决方案1】:

    iPad 上的 UIWebView 使用的默认 User-Agent 是:

    Mozilla/5.0 (iPad; CPU OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B141
    

    是的,它是一个 iPad 用户代理。

    您可以通过以下方式检查您的用户代理字符串:

    http://jonathangurebo.com/detect 或者 http://whatsmyuseragent.com

    如果您不想更改 UIWebView 中的用户代理,请查看此链接:Change User Agent in UIWebView (iPhone SDK)

    【讨论】:

    • 这很烦人。如果 UIWebView 中的网站包含适用于 iPad 的内容,则会显示在适用于 iPhone 的内容之上。这可能会导致感知页面无法按预期显示。
    • 谢谢,很有帮助
    猜你喜欢
    • 2011-01-10
    • 1970-01-01
    • 1970-01-01
    • 2011-08-25
    • 2011-05-23
    • 1970-01-01
    • 1970-01-01
    • 2014-02-02
    • 2014-11-05
    相关资源
    最近更新 更多