FloatingActionButton setVisibility() not working

后端 未结 6 1841
闹比i
闹比i 2021-02-07 07:13

I can\'t hide my FloatingActionButton. Here is my code:

XML:



    
         


        
6条回答
  •  轮回少年
    2021-02-07 07:55

    Use show and hide methods to show and hide the Floating Action Button

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    
    // To show the Floating Action Button
    fab.show();
    
    // To hide the Floating Action Button
    fab.hide();
    

提交回复
热议问题