Ich habe eine navigationsbasierte App mit einer Detailansicht (UIWebView) mit Aktionsschaltflächen am unteren Rand einer UIToolbar. Ich möchte 'Notizen' hinzufügen, wenn die Taste 'Notizen' gedrückt wird. Alles funktioniert gut, wenn die Webansicht im Hochformat ist. Ich drücke den Notenknopf, die modale Ansicht öffnet sich gut und funktioniert super.Modal View Controller startet nicht im Landscape-Modus
Das Problem tritt auf, wenn sich die Webansicht im Querformat befindet. Wenn ich die Notizen-Taste drücke, wird der gesamte Code zum Öffnen der modalen Ansicht aufgerufen, aber alles, was ich bekomme, ist ein weißer Bildschirm. Ein Kommentar: Wenn ich die modale Ansicht im Hochformat öffne und das Gerät dann drehe, dreht es sich gut in den Querformat-Modus. Es wird einfach nicht im Querformat korrekt öffnen.
Ich habe eine andere Schaltfläche, die den Mail-Composer, der das identische Verhalten hat, auftaucht. Hier ist der Code in meinem UIWebViewController:
- (IBAction)addNotes:(id)sender
{
NotesViewController *notesViewController;
// create the view controller and set it as the root view of a new navigation
// controller
notesViewController = [[NotesViewController alloc] initWithPrimaryKey:self.record.primaryKey];
UINavigationController *newNavigationController =
[[UINavigationController alloc] initWithRootViewController:notesViewController];
// present the navigation controller modally
[self presentModalViewController:newNavigationController animated:YES];
[notesViewController release];
[self.view setNeedsDisplay]; // not sure if I need this! I was trying different things...
[self.devotionText setNeedsDisplay]; // ditto...
[newNavigationController release];
}
Irgendwelche Ideen? Ich habe alle möglichen Dinge ausprobiert, ohne Erfolg. Ich bekomme nur einen weißen Bildschirm ohne Navigationsleiste (obwohl oben eine Statusleiste angezeigt wird).
Sind Sie auf dem neuesten Betriebssystem? Ich hatte Probleme mit dem Drücken einer Landscape-only modalen Ansicht im Portrait auf 3.1.3 ... –
Ja, ich bin mit dem 4.0 SDK ... – Glasswing