UIImagePickerController iOS 8 + iPhone 4s屏幕问题

问题描述:

我正在开发通用应用程序。我已经实现了图像选择器和代码,因为它如下所示。UIImagePickerController iOS 8 + iPhone 4s屏幕问题

isimagepiking=TRUE; 
imgPicker = [[UIImagePickerController alloc] init]; 
imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 
NSArray *mediaTypesAllowed = [NSArray arrayWithObject:@"public.image"]; 
[imgPicker setMediaTypes:mediaTypesAllowed]; 
imgPicker.delegate = self; 
imgPicker.allowsEditing = YES; 
imgPicker.wantsFullScreenLayout=true; 
if(UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPhone) 
{ 
    [self presentViewController:imgPicker animated:YES completion:nil]; 
} 

娄代码打印的大小。

NSLog(@"%f",imgPicker.view.frame.size.height); 

这东西工程iphone 5+与iOS 8.3和下面的ios 7.1 iphone 4的罚款,但在iPhone 4S的IOS 8+选择器不显示选择取消按钮

屏幕与ios 7.1 iphone 4s。 iOS 7.1 iPhone 4s screen-- This works fine

屏幕与iOS 8.2 iPhone 4S - 未显示选择取消按钮 Screen With iOS 8.2 iPhone 4s -- Not working properly

好像在iOS的8+它以uiscreen尺寸4英寸。 任何人都可以请帮助我这个。

由于提前

+0

检查self.view的大小。它应该是4英寸高。 – Ritu

+0

@Ritu感谢评论...我没有检查过它查看大小是预期的时候呈现pickerview – Satish

+0

@Ritu在解除self.view大小是568这是预期的iphone 4s – Satish

我希望呈现视图使问题。尝试addSubview

isimagepiking=TRUE; 
    imgPicker = [[UIImagePickerController alloc] init]; 
    imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 
    NSArray *mediaTypesAllowed = [NSArray arrayWithObject:@"public.image"]; 
    [imgPicker setMediaTypes:mediaTypesAllowed]; 
    imgPicker.delegate = self; 
    imgPicker.allowsEditing = YES; 
    imgPicker.wantsFullScreenLayout=true; 

    // Try Adding imagepicker as a subview 
    [self createAnimationsinView:self.view]; 
    [self.view addSubview:imgPicker.view] ; 

如果你想要一个当前的视图控制器动画,也可以这样做。

//当前视图控制器动画

-(void)createAnimationsinView:(UIView*)view{ 
    CATransition* transition = [CATransition animation]; 
    transition.duration = 0.5; 
    transition.type = kCATransitionMoveIn; 
    transition.subtype =kCATransitionFromTop; 
    [view.window.layer addAnimation:transition forKey:kCATransition]; 
} 
+0

感谢您的答复..这没有工作,但我有Tabbar在底部,所以再次取消并选择按钮不显示。 – Satish

+0

您是否尝试将imagePicker的大小设置为self.view.bounds? –

+0

是的..但它没有奏效...不改变选择器视图的大小.. – Satish