0

ia uiview compenentを作成し、以下のようにアプリケーションuiwindowに追加します。ポートレートモードでは正常に動作しますが、ランスケープモードに移行すると正しく動作しません。uiwindowは、そうではありませんが、それでもポートレートモードであると感じていると思います。ランドスケープモードで実行するにはどうすればよいですか?

ありがとう。

MyView * popupView = [[MyView alloc] initWithFrame:CGRectMake(0、0、320、480)url:url slideType:slidingType html5Flag:_html5Flag];
//フレームをCGRectMake(0、0,480、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;
4

1 に答える 1

0

回転するように自動化されたpopupViewを表示していますか?UIViewControllerクラスにこのメソッドを実装する必要があります。

- (void)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return YES;
}
于 2011-02-03T13:22:51.010 に答える