Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android gridLayout内的按钮太小_Android - Fatal编程技术网

Android gridLayout内的按钮太小

Android gridLayout内的按钮太小,android,Android,当我添加网格布局时,我总是遇到同样的问题 这是我的密码: <android.support.v7.widget.GridLayout android:layout_width="368dp" android:layout_height="258dp" android:layout_marginEnd="8dp" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" a

当我添加网格布局时,我总是遇到同样的问题

这是我的密码:

<android.support.v7.widget.GridLayout
    android:layout_width="368dp"
    android:layout_height="258dp"
    android:layout_marginEnd="8dp"
    android:layout_marginLeft="8dp"
    android:layout_marginRight="8dp"
    android:layout_marginStart="8dp"
    android:layout_marginTop="144dp"
    app:columnCount="2"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.0"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:rowCount="2">
    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button" />
</android.support.v7.widget.GridLayout>
这是一张图片:


请按以下方式更改您的代码:

<android.support.v7.widget.GridLayout
android:layout_width="368dp"
android:layout_height="258dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="144dp"
android:columnCount="2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:rowCount="2">
<Button
    android:id="@+id/button2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" />
我对android所做的更改:columnCount=2 android:rowCount=2

我知道了@zouve将您的android.support.v7.widget.GridLayout更改为GridLayout