【发布时间】:2011-02-03 13:11:24
【问题描述】:
我是一个 uiview 组件并将其添加到应用程序 uiwindow,如下所示。它在纵向模式下工作正常,但是当我进入横向模式时它不能正常工作。它认为 uiwindow 仍然感觉自己处于纵向模式,尽管不是。横屏怎么跑?
谢谢。
MyView* popupView = [[MyView alloc] initWithFrame:CGRectMake(0, 0, 320, 480) url:url 滑动类型:滑动类型 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;
【问题讨论】:
标签: iphone rotation landscape uiwindow