hi,
i want to add two subviews to window in my AppDelegateController. both in landscape mode. when i add the first view, it is in landscape (that's fine), but when adding the second, it is automatically in portrait mode. any advice?
thanks + regards
that's in my AppDelegate.m
[window addSubview:viewController.view];
CGRect frame = startviewController.view.frame;
frame.origin.x = 400;
frame.origin.y = 0;
startviewController.view.frame = frame;
[window addSubview:startviewController.view];
that's in my AppDelegate.h
@class LearnShiftViewController;
@class StartViewController;
@interface LearnShiftAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
LearnShiftViewController *viewController;
StartViewController *startviewController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet LearnShiftViewController *viewController;
@property (nonatomic, retain) IBOutlet StartViewController *startviewController;
In my MainWindow.xib I added both view controllers I want to add as subviews!
My way to make them landscape is putting this in the shouldAutorotateToInterfaceOrientation method of both view controllers:
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
and set the orientation to Landscape in InterfaceBuilder.