Android GridLayout方向就像垂直一样

时间:2016-03-26 14:47:34

标签: android

我不久前开始深入研究Android设计并且无法理解,为什么我的GridLayout方向表现得像一个垂直方向,因为我清楚地说明它是水平的。(点击下一步将我带到选择下面的EditField,而不是正确对象,真爱)。有人可以解释我在这里缺少的东西吗?

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="tiskevicius.armandas.myapplication.MainActivity"
    tools:showIn="@layout/activity_main"
    android:background="@drawable/ss"
    style="@style/AppTheme"
    android:theme="@style/AppTheme"
    android:touchscreenBlocksFocus="false">

    <GridLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:columnCount="7"
        android:rowCount="8"
        android:background="#AA181818"
        android:orientation="horizontal">

        <EditText
            android:inputType="numberDecimal"
            android:ems="3"
            android:id="@+id/editText2"
            android:layout_row="0"
            android:layout_column="0"
            android:editable="false"
            android:backgroundTint="#21a9e8"
            android:autoText="false"
            android:drawableTint="#aa1e1e"
            style="@style/Base.TextAppearance.AppCompat.Title"
            android:focusable="true"
            android:foregroundTint="#e50e0e"
            android:shadowColor="#ffffff"
            android:text="0,0"
            android:textAlignment="center"
            android:textColor="#21a9e8"
            android:textColorHighlight="#e142c4"
            android:textStyle="bold"
            android:textIsSelectable="false" />

        <EditText
            style="@style/Base.TextAppearance.AppCompat.Title"
            android:inputType="numberDecimal"
            android:ems="3"
            android:id="@+id/editText5"
            android:layout_row="0"
            android:layout_column="1"
            android:editable="false"
            android:backgroundTint="#21a9e8"
            android:autoText="false"
            android:drawableTint="#aa1e1e"
            android:focusable="true"
            android:foregroundTint="#e50e0e"
            android:shadowColor="#ffffff"
            android:text="0,1"
            android:textAlignment="center"
            android:textColor="#21a9e8"
            android:textColorHighlight="#e142c4"
            android:textStyle="bold"
            android:textIsSelectable="false" />

        <EditText
            android:inputType="numberDecimal"
            android:ems="3"
            android:id="@+id/editText3"
            android:layout_row="1"
            android:layout_column="1"
            android:backgroundTint="#21a9e8"
            android:autoText="false"
            android:drawableTint="#aa1e1e"
            style="@style/Base.TextAppearance.AppCompat.Title"
            android:focusable="true"
            android:foregroundTint="#e50e0e"
            android:shadowColor="#ffffff"
            android:text="1,1"
            android:textAlignment="center"
            android:textColor="#21a9e8"
            android:textColorHighlight="#e142c4"
            android:textStyle="bold" />

        <EditText
            android:inputType="numberDecimal"
            android:ems="3"
            android:id="@+id/editText4"
            android:layout_row="1"
            android:layout_column="2"
            android:editable="false"
            android:backgroundTint="#21a9e8"
            android:autoText="false"
            android:drawableTint="#aa1e1e"
            style="@style/Base.TextAppearance.AppCompat.Title"
            android:focusable="true"
            android:foregroundTint="#e50e0e"
            android:shadowColor="#ffffff"
            android:text="1,2"
            android:textAlignment="center"
            android:textColor="#21a9e8"
            android:textColorHighlight="#e142c4"
            android:textStyle="bold" />

        <EditText
            style="@style/Base.TextAppearance.AppCompat.Title"
            android:inputType="numberDecimal"
            android:ems="3"
            android:id="@+id/editText"
            android:layout_row="1"
            android:layout_column="0"
            android:editable="false"
            android:backgroundTint="#21a9e8"
            android:autoText="false"
            android:drawableTint="#aa1e1e"
            android:focusable="true"
            android:foregroundTint="#e50e0e"
            android:shadowColor="#ffffff"
            android:text="1,0"
            android:textAlignment="center"
            android:textColor="#21a9e8"
            android:textColorHighlight="#e142c4"
            android:textStyle="bold"
            android:textIsSelectable="false" />

        <EditText
            style="@style/Base.TextAppearance.AppCompat.Title"
            android:inputType="numberDecimal"
            android:ems="3"
            android:id="@+id/editText8"
            android:layout_row="0"
            android:layout_column="2"
            android:editable="false"
            android:backgroundTint="#21a9e8"
            android:autoText="false"
            android:drawableTint="#aa1e1e"
            android:focusable="true"
            android:foregroundTint="#e50e0e"
            android:shadowColor="#ffffff"
            android:text="0,2"
            android:textAlignment="center"
            android:textColor="#21a9e8"
            android:textColorHighlight="#e142c4"
            android:textStyle="bold"
            android:textIsSelectable="false" />

        <EditText
            android:inputType="numberDecimal"
            android:ems="3"
            android:id="@+id/editText6"
            android:layout_row="0"
            android:layout_column="3"
            android:editable="false"
            android:backgroundTint="#21a9e8"
            android:autoText="false"
            android:drawableTint="#aa1e1e"
            style="@style/Base.TextAppearance.AppCompat.Title"
            android:focusable="true"
            android:foregroundTint="#e50e0e"
            android:shadowColor="#ffffff"
            android:text="0,3"
            android:textAlignment="center"
            android:textColor="#21a9e8"
            android:textColorHighlight="#e142c4"
            android:textStyle="bold" />

        <EditText
            android:inputType="numberDecimal"
            android:ems="3"
            android:id="@+id/editText7"
            android:layout_row="2"
            android:layout_column="0"
            android:editable="false"
            android:backgroundTint="#21a9e8"
            android:autoText="false"
            android:drawableTint="#aa1e1e"
            style="@style/Base.TextAppearance.AppCompat.Title"
            android:focusable="true"
            android:foregroundTint="#21a9e8"
            android:shadowColor="#ffffff"
            android:text="2,0"
            android:textAlignment="center"
            android:textColor="#21a9e8"
            android:textColorHighlight="#e142c4"
            android:textStyle="bold" />

        <EditText
            style="@style/Base.TextAppearance.AppCompat.Title"
            android:inputType="numberDecimal"
            android:ems="3"
            android:id="@+id/editText9"
            android:layout_row="2"
            android:layout_column="1"
            android:editable="false"
            android:backgroundTint="#21a9e8"
            android:autoText="false"
            android:drawableTint="#aa1e1e"
            android:focusable="true"
            android:foregroundTint="#e50e0e"
            android:shadowColor="#ffffff"
            android:text="2,1"
            android:textAlignment="center"
            android:textColor="#21a9e8"
            android:textColorHighlight="#e142c4"
            android:textStyle="bold"
            android:textIsSelectable="false" />

        <EditText
            style="@style/Base.TextAppearance.AppCompat.Title"
            android:inputType="numberDecimal"
            android:ems="3"
            android:id="@+id/editText10"
            android:layout_row="2"
            android:layout_column="3"
            android:editable="false"
            android:backgroundTint="#21a9e8"
            android:autoText="false"
            android:drawableTint="#aa1e1e"
            android:focusable="true"
            android:foregroundTint="#e50e0e"
            android:shadowColor="#ffffff"
            android:text="2,3"
            android:textAlignment="center"
            android:textColor="#21a9e8"
            android:textColorHighlight="#e142c4"
            android:textStyle="bold"
            android:textIsSelectable="false" />

    </GridLayout>

</RelativeLayout>

0 个答案:

没有答案