1

나는 비디오를 선택하기 위해 공개 사진 갤러리를 가지고있다.동영상을 선택할 때`UIImagePickerController`의 제목을 바꿀 수 있습니까?

- (void)selectMediaFrom:(UIImagePickerControllerSourceType)sourceType { 
    UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; 
    imagePicker.sourceType = sourceType; 
    imagePicker.delegate = self; 
    //imagePicker.allowsEditing = YES; 

    if (selectedMediaType == MediaVideos) { 
     imagePicker.mediaTypes = @[(NSString *)kUTTypeMovie, (NSString *)kUTTypeVideo]; 
     if (sourceType == UIImagePickerControllerSourceTypeCamera) { 
      imagePicker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo; 
     } 
    } 
    else if (selectedMediaType == MediaPhotos) { 
     imagePicker.mediaTypes = @[(NSString *)kUTTypeImage]; 
     if (sourceType == UIImagePickerControllerSourceTypeCamera) { 
      imagePicker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto; 
     } 
    } 

    if (IS_IPHONE) { 
     [self presentViewController:imagePicker animated:TRUE completion:nil]; 
    } 
    else { 
     dispatch_async(dispatch_get_main_queue(), ^{ 

      [self setModalPresentationStyle:UIModalPresentationFormSheet]; 
      [self presentViewController:imagePicker animated:TRUE completion:nil]; 
     }); 
    } 
} 

그리고 항상 내가 첨부 한 스크린 샷을 참조, UIImagePickerController같은 사진의 제목을 보여주고있다 : 여기 내 코드입니다.

imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary and imagePicker.mediaTypes = @[(NSString *)kUTTypeMovie, (NSString *)kUTTypeVideo]

하지만, 아이폰 개방이 기본 비디오 폴더를 보여줍니다 사진 응용 프로그램 및 확인이 : 그것은 비디오 표시되지 왜 그런

Default Photos App

아래 참조 제목? 우리가 바꿀 수 있을까요?

+0

두 스크린 샷 폴더 제목은 모두 '동영상'입니다! 정확히 무엇을 묻고 있습니까? 당신이 성취하고자하는 것은 분명하지 않습니다! – Lion

+0

화면의 제목을 변경하고 싶다는 점을 분명히 언급했습니다. 첫 번째 스크린 샷을 참조하십시오. – VRAwesome

+0

화면의 제목을 변경하려면 동영상을 반올림 한 다른 화면을 추가해서는 안됩니다. 그것은 혼란을 일으키고 있습니다. 당신의 질문은'imagepicker 컨트롤러의 제목을 바꾸는 방법과 같아야합니까? '그게 다야! – Lion

답변

2

예 네비게이션의 제목을 원하는대로 변경할 수 있습니다.

출력을 참조하십시오 UINavigationControllerDelegate

스위프트 3.0

func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool){ 
    viewController.navigationItem.title = "Kirit Modi" 
} 

목표 C

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated{ 
    [viewController.navigationItem setTitle:@"Kirit Modi"]; 
} 

의 대리자를 추가

을 0

enter image description here