FloatingActionButton setVisibility() not working

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

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

XML:



    
         


        
6条回答
  •  甜味超标
    2021-02-07 08:00

    FloatingActionButton layers = (FloatingActionButton) findViewById(R.id.layers);
    layers.hide();
    

    It works for me, setVisibility doesn't work for FloatingActionButton as it belongs to another viewGroup that doesn't have setVisibility method.

提交回复
热议问题