zoukankan      html  css  js  c++  java
  • Chapter 11 UIImagePickerController

    Chapter 10 UIImagePickerController

     

    1. Setting the image picker’s sourceType:

    The sourceType constant that tells the image picker where to get images. It has three possible values:

    UIImagePickerControllerSourceTYpeCamera

    The user will take a new picture. This source type will not work on a device that does not have a camera. So, before using this type, you have to check for a camera by sending the message isSourceTypeAvailable: to the UIImagePickerController class.

    UIImagePickerControllerSourceTypePhotoLibrary

    The user will be prompted to select an album and then a photo from that album.

    UIImagePickerControllerSourceTypeSavedPhotosAlbum

    The user picks from the most recently taken photos.

     

    2. To present a view controller modally, you send presentViewController:animated:completion: to the UIViewController whose view is on the screen.

     

    3. Adding the ability to record video or choose a video from the disk is as simple as adding the constant string kUTTypeMovie to the mediaTypes array. However, not all devices support video through the UIImagePickerController. Just like the class method isSourceTypeAvailable: allows you to determine if the device has a camera, the availableMediaTypesForSourceType: method checks to see if that camera can capture video. To set up an image picker controller that can record video or take still images, you would write the following code:

     

    UIImagePickerController *ipc = [[UIImagePickerController alloc] init];

        NSArray *availableTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];

        ipc.mediaTypes = availableTypes;

        ipc.sourceType = UIImagePickerControllerSourceTypeCamera

        ipc.delegate = self;

     

  • 相关阅读:
    如何使用lr监视服务器linux的方法
    wc的使用
    mrtg 的配置和使用(从网上搜集的资料,自己整理过的)
    单元测试(从网上搜集的资料,自己总结整理过的)
    StatsD学习
    NodeJs NTLM认证(烂尾)
    用issnode+IIS来托管NodeJs Server之一:安装篇
    jQuery设置光标停留位置在文本最后(或在具体的位置)的办法
    Redis 相关资源
    纯CSS美化HTML的Table
  • 原文地址:https://www.cnblogs.com/1oo1/p/3985533.html
Copyright © 2011-2022 走看看