Use layout_gravity
instead of gravity
. layout_gravity
tells the parent where it should be positioned, and gravity
tells its child where they should be positioned.
<LinearLayout
android:id="@+id/groupNumbers"
android:orientation="horizontal"
android:layout_gravity="center_vertical"
android:layout_weight="0.7"
android:layout_width="wrap_content"
android:layout_height="wrap_content">