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

承载各个fragment的容器如果是FragmentContainerView或者Fragment,在调用register注册时会crash #173

Open
nicelyjust opened this issue Dec 1, 2022 · 2 comments

Comments

@nicelyjust
Copy link

使用Navigation时会crash,参考问题 #161

@aowoWolf
Copy link

aowoWolf commented Dec 2, 2022

目前我使用loadsir的确会遇到这种问题,如果你在activity中使用,直接用页面根布局注册是可以的,但是如果是在fragment中的话,建议包裹一层,如:

<FrameLayout
android:id="@+id/rootView"
>

<YourView/>
</FrameLayout>

包裹之后

<FrameLayout android:id=rootView>

<FrameLayout
android:id=container
>
<YourView/>
</FrameLayout>
</FrameLayout>

使用container去注册就可以了规避在fragment遇到的问题

ps:再附送一个注册可能会遇到的问题,smartrefreshLayout嵌套recyclerView,如果你用recyclerView去注册loadSir的话,生成的loadLayout可能的高度是0,从而布局白屏,也是同样处理,使用布局包裹一层,再去使用recyclerview注册,更简单的处理用smartRefreshLayout去注册也可以规避高度为0问题

@nicelyjust
Copy link
Author

@aowoWolf 谢谢 对我帮助很大

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