我有一个横向模式的应用程序,现在我在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;
}
见图