为什么我会收到此错误? The method setVerticalSpacing(int) is undefined for the type GridLayout
. 此方法适用于 GridLayout 视图。
这是我的 GridLayout 的声明:
GridLayout gameplayGL;
gameplayGL = new GridLayout(getApplicationContext());
gameplayGL.setVerticalSpacing(1);
gameplayGL.setHorizontalSpacing(1); //same error here
这应该是我应该能够在我的gameplayGL布局上运行的常规方法。我一定遗漏了一些明显的东西。为什么这会引发错误?