How to center a View inside of an Android Layout?


Question

I want to put a layout in the center of the screen.

1
72
9/19/2017 9:14:37 AM

Step #1: Wrap whatever it is you want centered on the screen in a full-screen RelativeLayout.

Step #2: Give that child view (the one, which you want centered inside the RelativeLayout) the android:layout_centerInParent="true" attribute.

145
6/13/2017 4:28:04 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon