2011-02-03 19 views
0

私はあなたの意見を反映し、以下のようにアプリケーションウィンドウに追加します。ポートレートモードではうまく動作しますが、lanscapeモードにすると正しく動作しません。 uiwindowはまだポートレートモードではあると感じています。ランドスケープモードではどのように実行できますか?uiwindowランドスケープモードの問題

ありがとうございました。

MYVIEW * popupView = [[MYVIEWのALLOC] initWithFrame:CGRectMake(0、0、320、480) URL:URLのslidingType:slidingType html5Flag:_html5Flag]。
//私はCGRectMake(0、0480、320)にフレームを変更するものの

[popupView setTitle:self.currentAd.altText]; 
popupView.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.5]; 

UIWindow* mainWindow = (((UIWindow*) [UIApplication sharedApplication].delegate).window); 

CGPoint middleCenter = popupView.center; 
CGSize offSize = [UIScreen mainScreen].bounds.size; 

CGPoint offScreenCenter = CGPointMake(offSize.width/2.0, offSize.height * 1.5); 

popupView.center = offScreenCenter; 
[mainWindow addSubview:popupView];  
popupView.center = middleCenter; 

答えて

0

に動作していないあなたはpopupViewが回転しautorized見ることですか? UIViewControllerクラスでこのメソッドを実装する必要があります。

- (void)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 
    return YES; 
} 
+0

はい、私はすでに、上に掲載されたコードでコントローラに実装しました。私はそれを見ているので、問題は回転していないようです。 – ysnky

関連する問題