2014-12-03 8 views
1

iOS 8 장치에 대해이 문제를 해결하는 방법에 대해 알 수 있습니다. UIAlertview에 대한 Apple의 구현 문제입니까?iPhone iOS8 : iOS7.1 SDK에서 빌드하고 8.0 및 그 이상의 장치에서 실행될 때 UIAlertView 상하 반전 회전이 올바르게 작동하지 않습니다.

동일한 스크린 샷이 있습니다. 그러나 보관에. 때문에 명성을 제한 :(iOS8의에서

+0

업로드 이미지를 업로드하고 여기에 링크 –

+0

를 공유 willrotatefrominterfaceorientaiton에 중단 점을 넣을 수 없습니다 프레임을 확인하십시오. 프레임에 아무런 변화가 없습니다. 회전 방법을 호출하지 않아야합니다. 사용중인 표시기가 표시되는지, 그리고 alertview가 프레임별로 업데이트되지 않는지 확인해야합니다. – iOSdev

답변

1

그 솔루션을 시도하는 대신

if (([[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] == NSOrderedAscending)) { 
    // use UIAlertView 
} 
else { 
    // use UIAlertController 

[self showAlert]; 
} 



-(void)showAlert 

{ 
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"AlertView" message:nil preferredStyle:UIAlertControllerStyleActionSheet; 
    UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"GO" style:UIAlertActionStyleDefault 
    handler:^(UIAlertAction * action) { 
    // [action doSomething]; 

    }]; 

    UIAlertAction* cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault 
    handler:^(UIAlertAction * action) { 
    [alert dismissViewControllerAnimated:YES completion:nil]; 

    }]; 

    [alert addAction:defaultAction]; 
    [alert addAction:cancel]; 
    [self presentViewController:alert animated:YES completion:nil]; 

    } 

UIAlertView

의 UIAlertController를 추가로

+0

언급 한 바와 같이 질문 제목에서 나는 7.1 SDk 응용 프로그램 및 UIAlertController 사용할 경우 컴파일되지 않습니다. IOS7.1 용 – Pinu

+0

IOS8 용 UIAlertView 사용 UIAlertController iOS7 및 ios8 용 조건을 작성해야합니다. –

+0

여기에서 필자는 7.1 SDK 만 사용하여 응용 프로그램을 빌드해야합니다. 그리고 8.0 + 조건으로 코드를 작성하더라도 7.1 SDK는 UIAlertController – Pinu