Android P visibilityawareimagebutton.setVisibility can only be called from the same library group

前端 未结 8 1846
不思量自难忘°
不思量自难忘° 2020-12-23 20:00

I\'m trying to use the new Android P FloatingActionButton that\'s part of the com.google.android.material.floatingactionbutton.FloatingActionButton and I\'m get

8条回答
  •  抹茶落季
    2020-12-23 20:38

    Seems to work fine just to cast it to a view.

    (mFloatingActionButton as View).visibility = INVISIBLE

    Of course you need to remember that the visibility may affect other components, so you should probably use show() and hide() at the same time to make sure other components are notified of the change.

提交回复
热议问题