Closed Tom-Shen closed 6 years ago
+1
Found a quick fix. Change initMenuScrollView
on _CLImageEditorViewController.m
to:
- (void)initMenuScrollView
{
if(self.menuView==nil){
UIScrollView *menuScroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, 80)];
menuScroll.top = self.view.height - menuScroll.height;
// Adjust for iPhone X
CGRect screenBounds = [[UIScreen mainScreen] bounds];
CGFloat screenScale = [[UIScreen mainScreen] scale];
if (screenBounds.size.width * screenScale == 1125 && screenBounds.size.height * screenScale == 2436) {
// iPhone X
menuScroll.top -= 20;
}
menuScroll.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
menuScroll.showsHorizontalScrollIndicator = NO;
menuScroll.showsVerticalScrollIndicator = NO;
[self.view addSubview:menuScroll];
self.menuView = menuScroll;
}
self.menuView.backgroundColor = [CLImageEditorTheme toolbarColor];
}
Building on the idea from @Tom-Shen, here's a slightly different version that should also handle landscape orientation:
// Adjust for iPhone X
if (@available(iOS 11.0, *)) {
UIEdgeInsets theInsets = [UIApplication sharedApplication].keyWindow.rootViewController.view.safeAreaInsets;
menuScroll.top = menuScroll.top - theInsets.bottom;
}
Thanks All, I'll fix it later.
Thanks for merging this into the latest build. And thanks VERY MUCH for the landscape support!
I am currently updating my app to the newly released iPhone X. CLImageEditor looks mostly fine, except for the bottom bar it is right under the home bar, being obscured. Would be better if the bottom bar can be lifted up on the new device.