2012-10-10 3 views

답변

0

문제를 해결할 수있었습니다. "DEFacebookComposeViewController.h"

그냥 다음 코드 교체 :

  • (무효) viewWillAppear : { [슈퍼 viewWillAppear 애니메이션 (BOOL)를 : 당신은 다음과 같은 파일의 코드 주석을 해제 할 필요가 애니메이션 ];

    // Take a snapshot of the current view, and make that our background after our view animates into place. 
    // This only works if our orientation is the same as the presenting view. 
    // If they don't match, just display the gray background. 
        if (self.interfaceOrientation == self.fromViewController.interfaceOrientation) { 
    //  UIImage *backgroundImage = [self captureScreen]; 
    //  self.backgroundImageView = [[[UIImageView alloc]    initWithImage:backgroundImage] autorelease]; 
        } 
        else { 
        //   self.backgroundImageView = [[[UIImageView alloc] initWithFrame:self.fromViewController.view.bounds] autorelease]; 
    } 
         // self.backgroundImageView.autoresizingMask = UIViewAutoresizingNone; 
    // self.backgroundImageView.alpha = 0.0f; 
    // self.backgroundImageView.backgroundColor = [UIColor lightGrayColor]; 
    // [self.view insertSubview:self.backgroundImageView atIndex:0]; 
    
    // Now let's fade in a gradient view over the presenting view. 
        self.gradientView = [[[DEFacebookGradientView alloc] initWithFrame:[UIApplication sharedApplication].keyWindow.bounds] autorelease]; 
        self.gradientView.autoresizingMask = UIViewAutoresizingNone; 
        self.gradientView.transform = self.fromViewController.view.transform; 
        self.gradientView.alpha = 0.0f; 
        self.gradientView.center = [UIApplication sharedApplication].keyWindow.center; 
        [self.fromViewController.view addSubview:self.gradientView]; 
        [UIView animateWithDuration:0.3f 
          animations:^ { 
           self.gradientView.alpha = 1.0f; 
          }];  
    
        self.previousStatusBarStyle = [UIApplication sharedApplication].statusBarStyle; 
        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque animated:YES]; 
    
        [self updateFramesForOrientation:self.interfaceOrientation]; 
    
         } 
    
  • 이 코드

: 그들은 유사한 문제를 발견하는 경우이 다른 도움이 될 것입니다

- (void)viewWillAppear:(BOOL)animated 
    { 
     [super viewWillAppear:animated]; 

    // Take a snapshot of the current view, and make that our background after our view animates into place. 
    // This only works if our orientation is the same as the presenting view. 
    // If they don't match, just display the gray background. 
if (self.interfaceOrientation == self.fromViewController.interfaceOrientation) { 
    UIImage *backgroundImage = [self captureScreen]; 
    self.backgroundImageView = [[[UIImageView alloc] initWithImage:backgroundImage] autorelease]; 
} 
else { 
    self.backgroundImageView = [[[UIImageView alloc] initWithFrame:self.fromViewController.view.bounds] autorelease]; 
} 
self.backgroundImageView.autoresizingMask = UIViewAutoresizingNone; 
self.backgroundImageView.alpha = 0.0f; 
self.backgroundImageView.backgroundColor = [UIColor lightGrayColor]; 
[self.view insertSubview:self.backgroundImageView atIndex:0]; 

    // Now let's fade in a gradient view over the presenting view. 
self.gradientView = [[[DEFacebookGradientView alloc] initWithFrame:[UIApplication sharedApplication].keyWindow.bounds] autorelease]; 
self.gradientView.autoresizingMask = UIViewAutoresizingNone; 
self.gradientView.transform = self.fromViewController.view.transform; 
self.gradientView.alpha = 0.0f; 
self.gradientView.center = [UIApplication sharedApplication].keyWindow.center; 
[self.fromViewController.view addSubview:self.gradientView]; 
[UIView animateWithDuration:0.3f 
       animations:^ { 
        self.gradientView.alpha = 1.0f; 
       }];  

self.previousStatusBarStyle = [UIApplication sharedApplication].statusBarStyle; 
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque animated:YES]; 

[self updateFramesForOrientation:self.interfaceOrientation]; 

    } 

희망.

감사합니다.

3

그냥

appDelegate.window.rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext; 

로 구현 모듈

self.modalPresentationStyle = UIModalPresentationCurrentContext; 

이 코드를 교체하고 작업이 완료 B 것, 어디서나 코드를 변경할 필요가 없습니다.

+1

이 문제가 해결되었습니다. 내가 처음에 그 원인을 이해했으면 좋겠다. –

+0

사실 그 라인이 잘못되었습니다. IT는 코드 내부 viewcontroller입니다. 외부 구현을위한 NOt입니다. –