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

ITable 中使用了 UIScrollView,UIScrollView自动调整高度时会,会出现控件下移的问题 #65

Open
zxssteven opened this issue May 2, 2017 · 1 comment

Comments

@zxssteven
Copy link

zxssteven commented May 2, 2017

问题:
UITabBarController , UINavigationController, ITable,三者混用时,特别在二级UINavigationController POP时后,ITable中的Row会出现下移问题。

解决办法:
1、在ITable.m 中viewDidLoad中增加 self.automaticallyAdjustsScrollViewInsets = NO; //禁止自动调整。
2、在init 在ITable.m 中init中增加:

    scrollFrame = CGRectMake(0, NAV_HEIGHT, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height-64-50);

在ITable.m 中layoutViews中自定义修改高度:

CGSize fsize = CGSizeMake(scrollFrame.size.width,
                                  scrollFrame.size.height );
        if(!CGSizeEqualToSize(_scrollView.frame.size, fsize)){
            log_debug(@"change size, w: %.1f=>%.1f, h: %.1f=>%.1f", _scrollView.frame.size.width, scrollFrame.size.width, _scrollView.frame.size.height, scrollFrame.size.height);
            CGRect frame = _scrollView.frame;
            frame.size = fsize;
            NSLog(@"%s,%d,%f",__func__,__LINE__,self.view.frame.size.height);
            
            _scrollView.frame = frame;
            _contentFrame.size.width = self.view.frame.size.width;
        }
@ideawu
Copy link
Owner

ideawu commented May 2, 2017

你好,如果能提供重现代码,并发一个 pull request,那将是最好的。

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