search

Home  >  Q&A  >  body text

ios7 下 在scrollView添加View 然后push再返回 发现前后页面控件位置发生偏移,不知道什么原因

我是在一个navigation controller - Tab controller - navigationcontroller- viewcontroller 再push到子界面,我是在tab controller里首页贴合view加了个scrollview,再在scrollview里加了view,scrollview里的view和控件都是按self.view来设置约束的,然后控件push返回的时候造成前后页面控件位置发生变化,不知道什么原因,是因为tabBarcontroller 里有两个导航栏控制器吗?

高洛峰高洛峰2887 days ago347

reply all(5)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:47:30

    self.automaticallyAdjustsScrollViewInsets = NO;
    

    Try setting it up on all pages?

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 17:47:30

    Has the poster solved this problem? I encountered it today and I’m so confused

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 17:47:30

    Page layout problem? Maybe try tabController first, then navgitionController? Add navgitionController to tabController?

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:47:30

    It’s the first time I see nav and add tab, and tab and nav

    reply
    0
  • PHPz

    PHPz2017-04-17 17:47:30

    Just post the code without saying anything

    • (void)viewWillAppear:(BOOL)animated {

      [super viewWillAppear:animated];
      self.automaticallyAdjustsScrollViewInsets = NO;
      

    reply
    0
  • Cancelreply