2015-06-02 58 views
0

我正在開發通用應用程序。我已經實現了圖像選擇器和代碼,因爲它如下所示。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

回答

0

我希望呈現視圖使問題。嘗試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