Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/210.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.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中,如何在不使用findViewByID的情况下显示图像?_Android - Fatal编程技术网

在Android中,如何在不使用findViewByID的情况下显示图像?

在Android中,如何在不使用findViewByID的情况下显示图像?,android,Android,我试图使一个图像出现在if语句中,但它不喜欢findviewbyd,那么是否有其他方式显示图像-错误表示无法解析为变量 public boolean play(int column){ for (int r = 0; r <= 5;r++){ if (getState(column, r) == State.BLANK){ if (player1Turn == true){ count[column][

我试图使一个图像出现在if语句中,但它不喜欢findviewbyd,那么是否有其他方式显示图像-错误表示无法解析为变量

    public boolean play(int column){
    for (int r = 0; r <= 5;r++){
        if (getState(column, r) == State.BLANK){
            if (player1Turn == true){
                count[column][r] = State.RED;               
                //image
                ImageView redCounter = (ImageView) findViewById.(R.id.redCounter);

                //end
            }else {
公共布尔播放(int列){

对于(int r=0;r代码中的问题是
findViewById之后的点(.)。

ImageView redCounter = (ImageView) findViewById.(R.id.redCounter);
就这样把它去掉

ImageView redCounter = (ImageView) findViewById(R.id.redCounter);

代码中的问题是
findViewById之后的点(.)。

ImageView redCounter = (ImageView) findViewById.(R.id.redCounter);
就这样把它去掉

ImageView redCounter = (ImageView) findViewById(R.id.redCounter);

它不喜欢findviewbyId
-这是什么意思?给定此错误无法解析为变量
它不喜欢findviewbyId
-这是什么意思?给定此错误无法解析为变量