Я работаю на IPad App, Там, когда мы нажмем на правую кнопку бар я даю действие, как показано ниже:как показать UIImagePickerControllerSourceTypeCamera в ландшафтном вместо Портретная
-(IBAction)camerabuttonAction:(id)sender
{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.delegate = self;
self.popoverController = [[UIPopoverController alloc] initWithContentViewController:picker];
[self.popoverController presentPopoverFromRect:CGRectMake(50, -250, 500, 300) inView:appDelegate.splitview.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
Моя проблема, когда я нахожусь в Режим Land Scape, если я нажму кнопку. Камера отображается в портретном режиме (изображение появляется в обратном режиме, чтобы видеть). Но, если я встряхнул iPad, то он появится в LandScape.
Для ориентации в iOS6 я использую ниже метод, но я сделал все, что связано с UIImagePickerControllerSourceTypeCamera
- (void)viewWillLayoutSubviews
{
if([self interfaceOrientation] == UIInterfaceOrientationPortrait||[self interfaceOrientation] ==UIInterfaceOrientationPortraitUpsideDown)
{
}
else if ([self interfaceOrientation] == UIInterfaceOrientationLandscapeLeft||[self interfaceOrientation] == UIInterfaceOrientationLandscapeRight)
{
}
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationPortrait;
}
Спасибо заранее
так, и означает ... я должен использовать cameraOverlayView, верно? – Babul
Но, если я поворачиваю свой портрет ipad к пейзажу, то камера показывает в LandScape @Vincent Saluzzo – Babul
@Babul Да, но это Apple. Вы должны использовать 'AVFoundation.framework', чтобы сделать это, если хотите быть надлежащим и уважать рекомендацию Apple. –