iphone - Load different xib files on Orientation in iOS -
I have created another file for another landscape mode for two I want to load the related Here is my code snippet, ViewAppDelegate.m Class << strong> border]]; ([UIApplication shared application]. Startbars Orientation == UIFrance Orientation Portrait | [UIAPCitration ShareApp] .Statsbar Orientation ==UINFterfaceArmentation PortraitUpdiddownDown) {Self Viewing Controller = [[Orientation VUIC Controller Allocon] In Whitneyname: @ "Portrait Controller" Bundle: Nile]; UINavigationController * Navigation Controller = [[UINavigationController alloc] initWithRootViewController: self.viewController]; Self.window.rootViewController = Navigation Controller; } Other {self.viewController = [[Orientation Week Controller Alok] initWithNibName: @ "Landscape Controller" bundle: zero]; UINavigationController * Navigation Controller = [[UINavigationController alloc] initWithRootViewController: self.viewController]; Self.window.rootViewController = Navigation Controller; } [Self. Windows MacKey & Wisbee]; Yes come back } ViewController.m class My app does not show anything after writing this code. It only shows the black screen Suggest some solution. try this type once To add a notification, add this method to the app view controller. .xib
.xib file on each rotation,
- (zero) viewDidload {{Super Viewedload]; // Setup an additional after loading the view, usually from a nibb. } - (BOOL) must be atorotettointeraction operation: (UINTERFERSEVERATION) Interface Orientation {return yes; } - {Zero} ViewViewsAll View {if ([UIPPC Shared Sharing] .Statsbar Orientation ==UINETERFESArmentation Portrait | [UIPPC SHARING APPLICATION] STATESBARE Orientation ==UINPerfectAuthentication PortraitSupaDiddown] {[NSBindal Main Bundle] LoadNIB Nominated: @ "Portrait Controller" Owner: Self-options: Nile]; } Other {[[NSBindal main bundle] Nominated Lodnb: @ "Landscape Controller" owner: Self-choice: zero]; }}
[[UIDewis Current Device] is launching DeviceAnnotationNotations]; [[NSNotificationCenter defaultCenter] addObserver: Self Selector: @Selector (Change Orientation) Name: UIDE AppointmentDead Change Notification Object: Zero];
- (zero) Change Orientation {UIDeviceOrientation orientation = [UIDevice currentDevice]. Consideration; If (Orientation == UIDivisternation Portrait || Orientation ==UIdivisOrmentation PortraitUpdidDown) {[NSBindal Main Bundle] Nominated Nominated: @ "Portrait" Owner: Self Option: Nil]; } And {[NSWindle Main Bundle] LodnIB nominated: @ "Landscape" owner: Self-choice: zero]; }}
Comments
Post a Comment