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
alignParentRight="true", but with Framelayout I did not find any such attributes. How do I align it to the bottom-right of screen?
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
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
I also ran into this situation and figured out how to do it using FrameLayout. The following output is produced by the code given below.
<FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" > <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/contactbook_icon" android:layout_gravity="center" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="140" android:textSize="12dp" android:textColor="#FFFFFF" android:layout_gravity="bottom|right" android:layout_margin="15dp" /> </FrameLayout>
Change the margin value to adjust the text position over the image. Removing margin might make the text to go out of the view sometimes.