Android - 从 Fragment 中设置 BottomSheet 中 FAB 按钮的可见性

Android - set visibility to FAB button in BottomSheet from within a Fragment

我需要从 Fragment class 中控制位于 BottomSheet 中的 Floating action button 可见性,但是当我尝试设置它的可见性时,我得到了这个错误信息:

VisibilityAwareImageButton.setVisibility can only be called from within the same library group (groupId=com.android.support)

这是我的片段 class:

private FloatingActionButton fabUpdateInfo;

fabUpdateInfo = getActivity().findViewById(R.id.fab_update);

fabUpdateInfo.setVisibility(View.GONE); //This is where the error message gets triggered 

只需使用:

fabUpdateInfo.hide();
//or
fabUpdateInfo.show();

而不是:

fabUpdateInfo.setVisibility();