0

我在下面的代码中使用 UIImagePickerController。编辑视图显示一个修剪窗口,您可以拖动它的开头或结尾。我希望能够创建一个可以滑动的固定持续时间的修剪窗口。

有谁知道这是否可能?或者有谁知道实现这一目标的自定义控件?或者你能建议一种自己创建这个的方法(如果它不是太复杂的话)?

- (BOOL) startCameraControllerFromViewController: (UIViewController*) controller
                                   usingDelegate: (id <UIImagePickerControllerDelegate,
                                                   UINavigationControllerDelegate>) delegate {

    if (([UIImagePickerController isSourceTypeAvailable:
          UIImagePickerControllerSourceTypeCamera] == NO)
        || (delegate == nil)
        || (controller == nil))
        return NO;


    UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
    cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;

    // Displays a control that allows the user to choose movie capture
    cameraUI.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];

    // Hides the controls for moving & scaling pictures, or for
    // trimming movies. To instead show the controls, use YES.
    cameraUI.allowsEditing = YES;

    cameraUI.delegate = delegate;

    [controller presentModalViewController: cameraUI animated: YES];
    return YES;
}
4

1 回答 1

0

我已经收集到,如果您想创建一个固定的窗口修剪编辑控制器,您需要从头开始编写代码。UIImagePickerController 中没有固定窗口大小的选项。

于 2013-02-20T21:15:52.247 回答