2016-09-10 14 views
0

サポートライブラリのGridlayoutに問題があります。私は列が等しくなるようにしたいと私は、このためにgrid:layout_columnWeighを使用していますが、何らかの理由の列が等しく見ていない:追加Gridlayoutセル幅のサイズが間違っています

enter image description here

activity_maps.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:grid="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

    <android.support.v7.widget.GridLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_weight="3" 
     grid:alignmentMode="alignMargins" 
     grid:columnCount="4" 
     grid:columnOrderPreserved="false" 
     grid:orientation="horizontal" 
     grid:rowOrderPreserved="false" 
     grid:useDefaultMargins="false"> 

     <android.support.design.widget.TextInputLayout 
      android:id="@+id/layout_lat1" 
      grid:layout_columnWeight="11" 
      android:layout_width="63dp"> 

      <EditText 
       android:id="@+id/lat1" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:hint="lat 1" 
       android:inputType="numberDecimal|numberSigned" /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:id="@+id/layout_long1" 
      grid:layout_columnWeight="1"> 

      <EditText 
       android:id="@+id/long1" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:hint="long 1" 
       android:inputType="numberDecimal|numberSigned" /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:id="@+id/layout_lat2" 
      grid:layout_columnWeight="1"> 

      <EditText 
       android:id="@+id/lat2" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:hint="lat 2" 
       android:inputType="numberDecimal|numberSigned" /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:id="@+id/layout_long2" 
      grid:layout_columnWeight="1" 
      > 

      <EditText 
       android:id="@+id/long2" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:hint="long 2" 
       android:inputType="numberDecimal|numberSigned" /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:id="@+id/layout_lat3" 
      grid:layout_columnWeight="1"> 

      <EditText 
       android:id="@+id/lat3" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:hint="lat 3" 
       android:inputType="numberDecimal|numberSigned" 
       grid:layout_columnWeight="1" /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:id="@+id/layout_long3" 
      grid:layout_columnWeight="1"> 

      <EditText 
       android:id="@+id/long3" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:hint="long 3" 
       android:inputType="numberDecimal|numberSigned" 
       grid:layout_columnWeight="1" /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:id="@+id/layout_lat4" 
      grid:layout_columnWeight="1"> 

      <EditText 
       android:id="@+id/lat4" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:hint="lat 4" 
       android:inputType="numberDecimal|numberSigned" /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:id="@+id/layout_long4" 
      grid:layout_columnWeight="1" 
      android:layout_width="wrap_content"> 

      <EditText 
       android:id="@+id/long4" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:hint="long 4" 
       android:inputType="numberDecimal|numberSigned" /> 
     </android.support.design.widget.TextInputLayout> 

     <Button 
      android:id="@+id/build_polygon" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Build Polygon" 
      grid:layout_columnSpan="2" /> 
    </android.support.v7.widget.GridLayout> 

    <fragment xmlns:map="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/map" 
     android:name="com.google.android.gms.maps.SupportMapFragment" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     tools:context="com.geobox.MapsActivity" /> 
</LinearLayout> 

答えて

0

てみてくださいすべての子コンポーネントで下の行に表示されます

grid:layout_columnWeight="1" 
関連する問題