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 8.2 iPhone 4S - 未显示选择或取消按钮
好像在iOS的8+它以uiscreen尺寸4英寸。 任何人都可以请帮助我这个。
由于提前
答
我希望呈现视图使问题。尝试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];
}
检查self.view的大小。它应该是4英寸高。 – Ritu
@Ritu感谢评论...我没有检查过它查看大小是预期的时候呈现pickerview – Satish
@Ritu在解除self.view大小是568这是预期的iphone 4s – Satish