【发布时间】:2016-08-01 21:40:20
【问题描述】:
自从用户将他们的操作系统更新到 ios 9.0 后,我有一个旧项目面临一个错误。问题是我的视图已加载,所有按钮和功能都可以正常工作,但 ui 只是空白。
这是我在 ios 9.1 上运行的应用
这是我的代码:
我的 viewcontroller.h 文件:
@property (strong, nonatomic) IBOutlet UIScrollView *theScrollView;
@property (weak, nonatomic) IBOutlet UIView *mainToolbar2;
我的 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];
我认为在 ios 9 上添加了一些我不知道的从 xib 文件中添加子视图的更改。如何解决此问题,以便应用也可以在 ios 9 上运行?
【问题讨论】:
标签: ios ipad uiview ios9 addsubview