Closed yudu233 closed 2 years ago
不会意思现在才看到,GitHub 的通知怪怪的,有时会不通知。请问解决了吗?没有的话发 onCreateView 的代码看一下。
我差资料说明是: FragmentContainerView只允许由Fragment.onCreateView(LayoutInflater, ViewGroup, Bundle)返回的view。试图添加任何其他视图将导致IllegalStateException。
onCreateView 里也没有别的代码 就那俩行添加view的代码
需要在 onCreateView 返回 loadingHelper.decorView,代码如下:
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
val view = layoutInflater.inflate(R.layout.fragment_home, container, false)
loadingHelper = LoadingHelper(view)
return loadingHelper.decorView
}
Views added to a FragmentContainerView must be associated with a Fragment
请问这样该如何添加