Android layout issue

I'm having a really hard time getting 2 buttons in the 2nd child line-lining to display as I want them ... I want them to be centered on the same line, but they appear to be left-aligned and on the same line Can anyone help me with this?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/black"
    android:orientation="vertical">

  <LinearLayout
      android:id="@+id/splash"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical">

    <ImageView
      android:id="@+id/imageLogo1"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:adjustViewBounds="true"
      android:cropToPadding="true"
      android:scaleType="fitXY"
      android:src="@drawable/isi_logo"
      android:paddingLeft="50sp"
      android:paddingRight="50sp"
      android:paddingTop="20sp"/>

    <ImageView
      android:id="@+id/imageLogo2"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:adjustViewBounds="true"
      android:cropToPadding="true"
      android:scaleType="fitXY"
      android:src="@drawable/sa_logo"
      android:paddingLeft="100sp"
      android:paddingRight="100sp"
      android:paddingBottom="20sp"/>

  </LinearLayout>

  <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:layout_gravity="center">

    <Button  
      android:id="@+id/buttonScores"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:width="100sp"
      android:text="@string/scores"/>

    <Button
      android:id="@+id/buttonStart"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:width="100sp"
      android:text="@string/test"/>

  </LinearLayout>

</LinearLayout>

      

+2


a source to share


1 answer


Try using android: gravity = "center" instead of android: layout_gravity = "center"



+4


a source







All Articles