0
我在橫向模式下有一個應用程序,現在我在appdelegate中添加了一個視圖,但是它顯示爲縱向模式。它是90度旋轉通過程序向橫向模式添加視圖
下面中的appdelegate加入我的代碼
-(void)addProcessingView{
UIView*container = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 500, 100)] autorelease];
container.backgroundColor = [UIColor grayColor];
UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(100, 0, 400, 100)] autorelease];
[container addSubview:label];
UIActivityIndicatorView *active = [[[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 100 , 100)] autorelease];
[container addSubview:active];
container.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
[self.window addSubview:container];
container.center = self.window.center;
}
見圖片
看到圖像添加 –
通過保持我的框架,你得到了這個形象 – Romance
沒有它由不是你改變原始代碼,索裏你的代碼也將無法正常工作 –