In XML, the equivalent of a Div is ViewGroup .
Example: LinearLayout , RelativeLayout , etc.
ViewGroups can contain views and controls, such as: TextView , Button and EditView .
Additional subclasses of ViewGroup
I created an example of what I think you are asking:
I used LinearLayout to store our views and controls.
Then I used android:gravity="center_horizontal" , on our LinearLayout , to center the children.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:gravity="center_horizontal" tools:context=".MainActivity" > <TextView android:layout_width="200dp" android:gravity="center_horizontal" android:layout_height="wrap_content" android:text="@string/hello_world" /> <Button android:layout_width="200dp" android:layout_height="wrap_content" android:text="@string/hello_world" /> <EditView android:layout_width="200dp" android:layout_height="wrap_content" android:text="@string/hello_world" /> </LinearLayout>
Here's what it looks like:

Evan bashir
source share