このエラーが発生するのはなぜですか? 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 レイアウトで実行できるルーチン メソッドである必要があります。明らかな何かが欠けているに違いありません。なぜこれがエラーをスローするのですか?