📜  在片段中使用视图绑定 - Java 代码示例

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

代码示例1
private FragmentJavaPracticeBinding binding;

@Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        binding = FragmentJavaPracticeBinding.inflate(inflater,container,false);
        return binding.getRoot();
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        binding.notesRecyclerView.setVisibility(View.VISIBLE);//this hide/show recyclerview visibility 
        Log.d("TAG", "hidden: ");
    }