0

它是android studio 2.3+的形式吗?google已更改如何使用网格布局。我正在尝试制作一个tic tac toe游戏,并且我制作了3X3网格布局,但是我无法将ImageView放入其中.. !!无法在android studio 2.3.2中的网格布局中拖放ImageView 2.3.2

这是XML文件

<?xml version="1.0" encoding="utf-8"?> 
<android.support.constraint.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
tools:context="com.example.neerajm.tictacbasic.MainActivity"> 

<GridLayout 
    android:layout_width="match_parent" 
    android:layout_height="360dp" 
    android:layout_marginBottom="8dp" 
    android:background="@drawable/board" 
    android:columnCount="3" 
    android:rowCount="3" 
    app:layout_constraintBottom_toBottomOf="parent" 
    app:layout_constraintHorizontal_bias="0.0" 
    app:layout_constraintLeft_toLeftOf="parent" 
    app:layout_constraintRight_toRightOf="parent" 
    app:layout_constraintTop_toTopOf="parent" 
    app:layout_constraintVertical_bias="0.797" 
    android:layout_marginTop="8dp"> 

</GridLayout> 

</android.support.constraint.ConstraintLayout> 

回答

0

我觉得首先你要创建类和主要活动中做出的对象类,并把你的网格布局

类Bdfd扩展的ImageView

MainActivity gridlayout gl Bdfd object = new Bdfd; gl.AddView(bdfd);

如果我理解你的问题,它必须是这样的东西..