zoukankan      html  css  js  c++  java
  • 横屏下的ImagePickerController

    Try this way....

    As per Apple Document, ImagePicker Controller never Rotate in Landscape mode. You have to use in Potrait Mode only.

    For disable Landscape mode only for ImagePicker Controller follow below code.

    In your ViewController.m

    Make the SubClass(NonRotatingUIImagePickerController) of Image Picker Controller

    @interface NonRotatingUIImagePickerController : UIImagePickerController
    
    @end
    
    @implementation NonRotatingUIImagePickerController
    // Disable Landscape mode.
    - (BOOL)shouldAutorotate
    {
        return NO;
    }
    @end

    Use as follow

    UIImagePickerController* picker = [[NonRotatingUIImagePickerController alloc] init];
            picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
            picker.delegate = self; 
      etc.... Just as Default ImagePicker Controller

    This is working for me & Let me know if you have any Problem.

    补充,需要再AppDelegate下面添加如下代码:

    - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {

        return UIInterfaceOrientationMaskAll;

    }

  • 相关阅读:
    jmeter基础介绍
    mysql图形化工具navicat
    JMeter 进行压力测试
    windows ADB配置java adk / Android adk
    性能指标
    压力测试和负载测试(tps/qps)专项测试,吞吐量
    接口测试工具Postman
    charles步骤装
    Python列表操作
    Python字符串常见操作
  • 原文地址:https://www.cnblogs.com/scaptain/p/4036984.html
Copyright © 2011-2022 走看看