2014-12-31 5 views
0

이미지를 선택하여 컬렉션보기로 표시하는 프로젝트가 있습니다. UIImagePickerController을 사용했지만 디자인 제한이 있습니다.iOS7 + 이미지 피킹의 우수 사례 (> 2014)

필자는 실제로 프로젝트의 나머지 부분의 디자인에 맞도록 피커 컨트롤러 (크기 및 색상)를 포맷하고 싶습니다. 이 주제에 대한 많은 질문은 "AVFoundation으로 이동"으로 회신합니다. 그러나 AVFoundation은 이러한 종류의 작업을 수행 할 때 다루기 힘들어 보입니다.

내 질문에.

UPDATE :

이미지 피커 .. 내가 피커 프레임의 크기를 제어 할 수 있도록하고 싶습니다 호출하는 코드를 추가.

- (IBAction)useCameraRoll:(id)sender { 
    NSLog(@"%s", __FUNCTION__); 
    if ([UIImagePickerController isSourceTypeAvailable: 
     UIImagePickerControllerSourceTypeSavedPhotosAlbum]) 
    { 
     UIImagePickerController *imagePicker = 
     [[UIImagePickerController alloc] init]; 
     imagePicker.delegate = self; 
     imagePicker.sourceType = 
     UIImagePickerControllerSourceTypePhotoLibrary; 
     imagePicker.mediaTypes = @[(NSString *) kUTTypeImage]; 
     imagePicker.allowsEditing = NO; 

     //imagePicker.navigationBar.tintColor = [UIColor redColor]; 
     [[UINavigationBar appearance] setBarTintColor:[UIColor redColor]]; 
     [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; 
     [[UINavigationBar appearance] setFrame:CGRectMake(0,0,300, 300)]; 
     [[UICollectionView appearanceWhenContainedIn:[UIImagePickerController class], nil] setBackgroundColor:[UIColor greenColor]]; 

     [self presentViewController:imagePicker animated:YES completion:nil]; 
     _newMedia = NO; 

    } 

} 
+0

카메라 또는 라이브러리 선택 도구에 대해 이야기하고 있습니까? – Logan

+0

죄송합니다 - 도서관 피커 –

답변

2

당신은 appearance를 사용하여 UINavigationController/UINavigationBar을 사용자 정의 할 수 있습니다 :

[[UINavigationBar appearance] setBarTintColor:[UIColor blueColor]]; 
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; 

같은 당신의 모양을 사용자 정의 도구 모음 등을 위해 수행 할 수있다.

+0

그건 대단합니다 .. 피커 자체의 배경색, 특히 프레임 크기를 변경할 수있는 방법이 있습니까? –

+0

배경색 :이 방법이 효과가 있으면 좋겠지 만 다음을 시도해보십시오.'[[UICollectionView appearanceWhenContainedIn : [UIImagePickerController class], nil] setBackgroundColor : [UIColor greenColor];'나는 궁금 해서요. 이 트릭을 않습니다. – Logan

+0

프레임 크기의 경우 전체보기 컨트롤러의 크기 또는 셀 크기에 대해 이야기하고 있습니까? 세포의 경우, 당신이 많은 통제권을 갖고 있는지 확신 할 수 없습니다. 뷰 컨트롤러의 경우 뷰를 하위 뷰로 추가하는 경우 다른 뷰와 마찬가지로 크기를 조정할 수 있어야합니다. – Logan