iphone - Modal View Controller Won't Start in Landscape Mode -
i have navigation based app has detail view (uiwebview) action buttons across bottom in uitoolbar. want add 'notes' when 'notes' button pushed. works fine when webview in portrait mode. press notes button, modal view opens fine , works great.
the problem occurs when webview in landscape mode. if press notes button, code open modal view gets called white screen. 1 comment: if open modal view in portrait , rotate device, rotates fine landscape mode. won't open correctly in landscape mode.
i have button brings mail composer has identical behavior. here code in uiwebviewcontroller:
- (ibaction)addnotes:(id)sender { notesviewcontroller *notesviewcontroller; // create view controller , set root view of new navigation // controller notesviewcontroller = [[notesviewcontroller alloc] initwithprimarykey:self.record.primarykey]; uinavigationcontroller *newnavigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:notesviewcontroller]; // present navigation controller modally [self presentmodalviewcontroller:newnavigationcontroller animated:yes]; [notesviewcontroller release]; [self.view setneedsdisplay]; // not sure if need this! trying different things... [self.devotiontext setneedsdisplay]; // ditto... [newnavigationcontroller release]; }
any ideas? i've tried sorts of different things no avail. white screen no navigation bar (although there status bar @ top).
modals don't information rotations, , info status bar, doesn't work right. put in viewwillappear fix: [uiapplication sharedapplication].statusbarorientation = self.interfaceorientation
and, if want navigation controller inside modal, need create one.
also, don't need setneedsdisplay. effects current views, not modal presenting.
Comments
Post a Comment