zoukankan      html  css  js  c++  java
  • 适配iPad的操作表sheet

    UIAlertController *alert = [UIAlertController

            alertControllerWithTitle:@"上传文件"

                             message:@"请选择"

                      preferredStyle:UIAlertControllerStyleActionSheet];之后插入下面这段代码,就可以完成适配。

    UIPopoverPresentationController *popover =
    
            alert.popoverPresentationController;
    
        // UIButton *button = (UIButton *)sender;
    
        if (popover) {
    
          popover.sourceRect =
    
              CGRectMake(self.view.center.x, self.view.frame.size.height, 0, 0);
    
          popover.sourceView = self.view;
    
          popover.permittedArrowDirections = UIPopoverArrowDirectionDown;
    
        }

    最后,推出

    [self presentViewController:alert animated:YES completion:nil];

    成功。

  • 相关阅读:
    python socket 二进制
    全面介绍内存管理机制
    glog修改
    mysql c api
    http twisted
    IOCP 模型1
    IOCP 模型2 AcceptEx
    python
    Python Twisted
    Java 拾遗
  • 原文地址:https://www.cnblogs.com/hd1992/p/5130496.html
Copyright © 2011-2022 走看看