在Activity中是
inflate = ActivityLoginBinding.inflate(getLayoutInflater());
setContentView(inflate.getRoot());
fragment:
View view = inflater.inflate(R.layout.fragment_sub_main, container, false);
mFragmentMainBinding= FragmentSubMainBinding.bind(view);
return view;
这样理解,由于fragment的布局返回在oncreateview方法并且是个view对象,显然无法通过binding的inflate实现,所以通过bind绑定