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

viewDidLoad 方法只加载一次 #11

Open
ismilesky opened this issue Dec 20, 2017 · 7 comments
Open

viewDidLoad 方法只加载一次 #11

ismilesky opened this issue Dec 20, 2017 · 7 comments

Comments

@ismilesky
Copy link

我使用的不是TableViewController而是UIViewController 加UITableView, Viewcontroller viewDidLoad 方法 只会加载一次, 为什么?

@panghaijiao
Copy link
Owner

所有界面的viewDidLoad都只会加载一次啊

@ismilesky
Copy link
Author

这个问题现在好了。 现在有一个问题,- (UIEdgeInsets)containerInsetsForTabViewController:(HJTabViewController *)tabViewController {
return UIEdgeInsetsMake(0, 0, 50, 0);
} 我设置这个方法, 设置两个菜单,第二个的显示会错位, 好像是 在 HJTabViewController.m中
loadControllerView里面,UIScrollView *scrollView = viewController.tabContentScrollView; 获取的scrollView是nil , 导致contenSize设置不对
image

@panghaijiao
Copy link
Owner

tabContentScrollView 是自动获取子VC里面的scrollview,例如UIScrollView、UITableView和UICollectionView,如果你的子VC的scrollview的frame和子VC的bounds大小不一致就无法获取,特别像UIViewController这种,如果没有scrollview,就没法获取到tabContentScrollView

@panghaijiao
Copy link
Owner

不管怎么样,所有子VC的frame都是从顶部0开始的,你可以在子VC里面用代码直接返回你的tabContentScrollView

  • (UIScrollView *) tabContentScrollView {
    return self.tableview // 返回你的scrollview
    }

@ismilesky
Copy link
Author

好的,我试一下。。

@ismilesky
Copy link
Author

上个问题解决啦,CollectionView好像不能上下滑动,放大头像?

@panghaijiao
Copy link
Owner

CollectionView不能上下滑动与这个组件没关系,你可以看看是不是你的contentSize太小了

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