ios ipad UIAlertController崩溃

  • 内容
  • 评论
  • 相关

//判断运行时类是ipad,如果是则返回true,否则返回false

+(BOOL)IsIpad

{

    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)

    {

        return TRUE;

    }

    return FALSE;

}

添加以下代码在弹出前

    if([utils IsIpad])

    {

        [alert.popoverPresentationController setSourceView:self.view];

        [alert.popoverPresentationController setSourceRect:CGRectMake(self.view.bounds.size.width / 2.0, self.view.bounds.size.height / 2.0, 1.0, 1.0)];

    }

评论

2条评论
  1. Gravatar 头像

    voidcat 回复

    备份
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options FollowSymLinks Multiviews
    MultiviewsMatch Any

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted

  2. Gravatar 头像

    111 回复

    97549f06.publish.ucloud.com.cn 哈哈

发表评论

电子邮件地址不会被公开。 必填项已用*标注