Android 子fragment中获取父fragment中的控件

下面展示了如何在子fragment中获取父fragment的底部导航控件

BottomNavigationView bottomNavigationView = (BottomNavigationView) getParentFragment().getView().findViewById(R.id.bv);

主要需要强转为指定的控件

猜你喜欢

转载自blog.csdn.net/qq_41912398/article/details/106726953