Я пытаюсь создать приложение в студии android, и по некоторым причинам один gridLayout решает не появляться, несмотря на то, что он занимает необходимое пространство на экране. Image from android studio, actual screenshot from my phoneGridlayout не отображается, Android studio
XML файл макета:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#cbcde6"
android:orientation="vertical"
android:gravity="top|center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Insert data"
android:textAppearance="?android:attr/textAppearanceLarge"
/>
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="top"
android:columnCount="3"
android:rowCount="3"
android:visibility="visible">
<EditText
android:background="#ffffff"
android:layout_height="30sp"
android:layout_margin="15dp"
android:layout_columnWeight="1"/>
<EditText
android:background="#ffffff"
android:layout_height="30sp"
android:layout_margin="15dp"
android:layout_columnWeight="1"/>
<EditText
android:background="#ffffff"
android:layout_height="30sp"
android:layout_margin="15dp"
android:layout_columnWeight="1"/>
<EditText
android:background="#ffffff"
android:layout_height="30sp"
android:layout_margin="15dp"
android:layout_columnWeight="1"/>
<EditText
android:background="#ffffff"
android:layout_height="30sp"
android:layout_margin="15dp"
android:layout_columnWeight="1"/>
<EditText
android:background="#ffffff"
android:layout_height="30sp"
android:layout_margin="15dp"
android:layout_columnWeight="1"/>
<EditText
android:background="#ffffff"
android:layout_height="30sp"
android:layout_margin="15dp"
android:layout_columnWeight="1"/>
<EditText
android:background="#ffffff"
android:layout_height="30sp"
android:layout_margin="15dp"
android:layout_columnWeight="1"/>
<EditText
android:background="#ffffff"
android:layout_height="30sp"
android:layout_margin="15dp"
android:layout_columnWeight="1"/>
</GridLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Calculate"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Result is: "
android:textAppearance="?android:attr/textAppearanceLarge"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Result"
android:textAppearance="?android:attr/textAppearanceLarge"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="bottom">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/backButton_text"
android:id="@+id/back"
android:onClick="onClickBackButton"
android:textAppearance="?android:attr/textAppearanceLarge"/>
</LinearLayout>
</LinearLayout>
Спасибо, зная, что андроид: layout_columnWeight работает только на api 21 или позже (my is api 19), я искал альтернативу, и я нашел это [link] (http://developer.android.com/reference/android/support/percent/packag е-summary.html). –