Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

用一个UINavigationController包了searchViewController,present出来后,出现如图问题 #215

Closed
CCBrother opened this issue Apr 24, 2019 · 3 comments

Comments

@CCBrother
Copy link

问题描述

用一个UINavigationController包了searchViewController,present出来后,出现如图问题,页面会置顶了

代码如下:
self.searchNav = [[UINavigationController alloc] initWithRootViewController:searchViewController];
[self presentViewController:self.searchNav animated:NO completion:nil];

重现步骤

图片

预期结果

实际结果

受影响的设备

版本信息

  • PYSearch:vX.X.X
  • Xcode:vX.X.X
  • macOS:vX.X.X
  • CocoaPods:vX.X.X
@ko1o
Copy link
Owner

ko1o commented Apr 25, 2019

@CCBrother 可能是iOS 11.0以后 tableview的问题,试试添加一下代码:

    if (@available(iOS 11.0, *)) {
        [UITableView appearance].estimatedRowHeight = 0;
        [UITableView appearance].estimatedSectionFooterHeight = 0;
        [UITableView appearance].estimatedSectionHeaderHeight = 0;
        [UITableView appearance].contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
        [UIScrollView appearance].contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    }

@CCBrother
Copy link
Author

还是不行,看视图,tableview没问题,是历史记录的那个view,上移了

@CCBrother
Copy link
Author

加一句这个 self.searchNav.navigationBar.translucent = NO; 就可以了,导航栏问题

@ko1o ko1o closed this as completed Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants