📜  不要在导航组件中重新加载片段 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:57.808000             🧑  作者: Mango

代码示例1
private var view: View? = null

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {

    if (view == null) {
        view = inflater.inflate(R.layout.fragment_list, container, false)
                //...
    }

    return view

 }