Ich habe ein altes Projekt, das mit einem Fehler konfrontiert ist, seit der Benutzer sein Betriebssystem auf iOS 9.0 aktualisiert hat. Die Sache ist meine Ansicht ist geladen, alle Taste und Funktion funktioniert gut, aber die UI ist nur leer.Wie Subview von Xib-Datei in IOS 9 hinzufügen?
hier Screenshot von meinem App auf ios 8,1
laufen und hier ist mein App auf ios 9,1
läuft Und hier ist mein Code:
meine Viewcontroller .h-Datei:
@property (strong, nonatomic) IBOutlet UIScrollView *theScrollView;
@property (weak, nonatomic) IBOutlet UIView *mainToolbar2;
mein viewcontroller.m:
CGRect scrollViewRect = CGRectInset(viewRect, -scrollViewOutset, 0.0f);
self.theScrollView = [[UIScrollView alloc] initWithFrame:scrollViewRect]; // All
self.theScrollView.autoresizesSubviews = NO;
self.theScrollView.contentMode = UIViewContentModeRedraw;
self.theScrollView.showsHorizontalScrollIndicator = NO;
self.theScrollView.showsVerticalScrollIndicator = NO;
self.theScrollView.scrollsToTop = NO;
self.theScrollView.delaysContentTouches = NO;
self.theScrollView.pagingEnabled = YES;
self.theScrollView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
self.theScrollView.backgroundColor = [UIColor redColor];
self.theScrollView.delegate = self;
if (_isArabic) {
self.theScrollView.transform=CGAffineTransformMakeRotation(M_PI * (180)/180.0);
}
[self.mainView addSubview:self.theScrollView];
CGRect toolbarRect = viewRect;
toolbarRect.size.height = TOOLBAR_HEIGHT;
self.mainToolbar = [[ReaderMainToolbar alloc] initWithFrame:toolbarRect document:document]; // ReaderMainToolbar
self.mainToolbar.delegate = self; // ReaderMainToolbarDelegate
[self.mainView addSubview:self.mainToolbar];
if (fakeStatusBar != nil) [self.mainView addSubview:fakeStatusBar]; // Add status bar background view
for (UIView *subView in self.mainToolbar.subviews)
{
[subView removeFromSuperview];
}
[self.mainToolbar addSubview:self.mainToolbar2];
Ich denke, es gibt einige Veränderungen auf ios 9 für Subview aus xib Datei hinzufügen, die ich nicht kannte. Wie kann ich dieses Problem beheben, damit die App auch auf ios 9 ausgeführt werden kann?