Skip to content
Advertisement

Problem with positioning FloatingActionButton in Fragment

I have problem with positioning FAB inside Fragment. FAB is on the top left, but I need it on the bottom right.

JavaScript

enter image description here

What I have wrong?

Advertisement

Answer

as I have read , FAB doesn’t work with relative layout very well and you should use Coordinator Layout instead.

  • first include its dependency in build.gradle(Module:app)
JavaScript
  • then declare Coordinator Layout like this instead of relative layout
JavaScript

If you want more information you can read more about the FAB here

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement