Android design library 25.1.0 causes FloatingActionButton.Behavior to stop working

后端 未结 2 569
孤城傲影
孤城傲影 2020-12-14 20:24

I\'ve been using this FloatingActionButton.Behavior for many months now, it takes care of hiding and showing the FAB of my application. Never had an issue.

p         


        
相关标签:
2条回答
  • 2020-12-14 20:53

    For 25.1.0, CoordinatorLayout is skipping views set to GONE when looking for behaviors to call in its onNestedScroll method.
    The solution is replacing FAB's visibility GONE with INVISIBLE.
    Simply, change:

    child.hide();  
    

    to:

    child.hide(new FloatingActionButton.OnVisibilityChangedListener() {
            @Override
            public void onHidden(FloatingActionButton fab) {
                super.onHidden(fab);
                fab.setVisibility(View.INVISIBLE);
            }
        });
    
    0 讨论(0)
  • 2020-12-14 20:53

    I have absolutely the same problem, looks like there is a bug in 'support-design package'. The only thing that we can do now, I believe, is rollback to one of previous versions. I decided to use the following:

    compile 'com.android.support:design:25.0.1'
    
    0 讨论(0)
提交回复
热议问题