2016-04-11 18 views
0

ユーザーが自分のOSをiOS 9.0にアップデートしてから、バグに直面している古いプロジェクトがあります。事は私のビューがロードされ、すべてのボタンと機能は正常に動作していますが、UIはただ空白です。ここios 9でxibファイルからサブビューを追加するには?

は私のアプリは、IOS 8.1 enter image description here

、ここで実行しているのスクリーンショットである私のアプリは、iOS 9.1

enter image description here

そして、ここに私のコードです上で実行されている:

私のViewController .hファイル:

@property (strong, nonatomic) IBOutlet UIScrollView *theScrollView; 
@property (weak, nonatomic) IBOutlet UIView *mainToolbar2; 

私viewcontroller.m:私は知りませんでしたXIBファイルからサブビューを追加するためのIOS 9に何らかの変化があると思い

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]; 

。アプリがios 9でも実行できるように、この問題を解決するにはどうすればよいですか?

答えて

0

私はサブビューを追加することに違いはないと思います。あなたは@property (weak, nonatomic) IBOutlet UIView *mainToolbar2; ラインに強いと弱いラインself.theScrollView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);

  • 変更...のような

    • コメントを何かをしようとします
  • 関連する問題