Search code examples
androidlayout

Android: Align button to bottom-right of screen using FrameLayout?


I am trying to put the zoom controls of the map on the bottom right corner of screen. I could do it with RelativeLayout using both alignParentBottom="true" and alignParentRight="true", but with Framelayout I did not find any such attributes. How do I align it to the bottom-right of screen?


Solution

  • Actually it's possible, despite what's being said in other answers. If you have a FrameLayout, and want to position a child item to the bottom, you can use android:layout_gravity="bottom" and that is going to align that child to the bottom of the FrameLayout.

    I know it works because I'm using it. I know is late, but it might come handy to others since this ranks in the top positions on google