<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="100"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/reletive"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/output"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:text="Hello World!"
android:textSize="30sp" />
<TextView
android:id="@+id/input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/output"
android:gravity="end"
android:text="Hello World!"
android:textSize="30sp" />
</RelativeLayout>
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/grid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/reletive"
android:numColumns="5"
tools:ignore="InvalidId">
<Button
android:layout_row="0"
android:layout_rowWeight="1"
android:layout_column="0"
android:layout_columnWeight="1"
android:text="1" />
<Button
android:layout_row="0"
android:layout_rowWeight="1"
android:layout_column="1"
android:layout_columnWeight="1"
android:text="1" />
<Button
android:layout_row="0"
android:layout_rowWeight="1"
android:layout_column="2"
android:layout_columnWeight="1"
android:text="1" />
<Button
android:layout_row="0"
android:layout_rowWeight="1"
android:layout_column="3"
android:layout_columnWeight="1"
android:text="1" />
<Button
android:layout_row="0"
android:layout_rowWeight="1"
android:layout_column="4"
android:layout_columnWeight="1"
android:text="1" />
<Button
android:layout_row="1"
android:layout_rowWeight="1"
android:layout_column="0"
android:layout_columnWeight="1"
android:text="1" />
<Button
android:layout_row="1"
android:layout_rowWeight="1"
android:layout_column="1"
android:layout_columnWeight="1"
android:text="1" />
<Button
android:layout_row="1"
android:layout_rowWeight="1"
android:layout_column="2"
android:layout_columnWeight="1"
android:text="1" />
<Button
android:layout_row="1"
android:layout_rowWeight="1"
android:layout_column="3"
android:layout_columnWeight="1"
android:text="1" />
<Button
android:layout_row="1"
android:layout_rowWeight="1"
android:layout_column="4"
android:layout_columnWeight="1"
android:text="1" />
</GridLayout>
</RelativeLayout>
Я использую GridLayout в нижней части Relative Layout. Я хочу добавить 5 колонок в это, но не добавлено. Когда я добавляю 5 столбец, это ведет себя очень плохо. Я хочу сделать научный калькулятор, и я хочу использовать макет сетки, чтобы расположить мою кнопку «все».
Я хочу использовать таблицу 5X7 для размещения кнопки «Все». Я пытаюсь несколько раз, но я не могу добавить 5-й столбец в моем коде.