J'essaie de créer une application dans un studio android, et pour certaines raisons, un gridLayout décide de ne pas apparaître, malgré le fait qu'il prend l'espace nécessaire sur l'écran. Image from android studio, actual screenshot from my phoneGridlayout ne montre pas, Android studio
fichier XML de la mise en page:
<?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>
Merci, sachant que Android: layout_columnWeight ne fonctionne que sur api 21 ou plus tard (le mien est api 19), j'ai cherché une alternative, et je l'ai trouvé [link] (http://developer.android.com/reference/android/support/percent/packag e-summary.html). –