Meine App Die meisten Seiten sind Landschaft, nur ein paar Seiten sind Portrait. Image zeigt mein Problem. Im Fall von Hochformat ist die Position der Symbolleiste über Tastatur/Datumsauswahl nicht korrekt. Ich Geräteausrichtung eingestellt sind, Porträt/Landschaft links/Landschaft rechts. Und in Portrait Seite meinen CodeiOS-Symbolleiste über Tastaturposition nicht korrekt
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
if ([NSObject isiPhone]) {
return UIInterfaceOrientationPortrait;
}
return UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationLandscapeRight;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
if ([NSObject isiPhone]) {
return UIInterfaceOrientationMaskPortrait;
}
return UIInterfaceOrientationMaskLandscape;
}
- (BOOL)shouldAutorotate{
return YES;
}
Die Folge sind meine Symbolleiste Code:
UIToolbar *toolbar=[[UIToolbar alloc]init];
toolbar.barTintColor=[UIColor lightTextColor];
toolbar.frame=CGRectMake(0, 0, 320, 44);
UIBarButtonItem *item2=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
UIBarButtonItem *item3=[[UIBarButtonItem alloc]initWithTitle:@"OK" style:UIBarButtonItemStylePlain target:self action:@selector(click)];
toolbar.items = @[item2,item3];
self.babyBirthdayTextfield.inputAccessoryView=toolbar;
Das Problem trat auch auf Web-Ansicht my app Portrait view's structure
ich das Problem behoben haben. Der Hauptcontroller dieses Storyboards ist ein modales Fenster. Ändern der Art des Segments
Bitte fügen Sie weiteren Code in Bezug auf, wie Sie Ihre Tastatur hinzufügen – atulkhatri