为什么我收到此错误? 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布局上运行的常规方法。我一定错过了一些明显的东西。为什么会抛出错误?