Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/354.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
Java ImageView没有';即使我将其设置为不可见,也不要将其自身设置为不可见_Java_Android - Fatal编程技术网

Java ImageView没有';即使我将其设置为不可见,也不要将其自身设置为不可见

Java ImageView没有';即使我将其设置为不可见,也不要将其自身设置为不可见,java,android,Java,Android,我正在开发一款纸牌游戏,我正在尝试在第二位玩家玩完他的牌后将其设置为不可见。 但即使我将ImageView设置为不可见,它也不会变为不可见。 这是我的密码: case HAND_CHECK: // give winned cards to the winning player giocatoreGiocante =tavoloDaGioco.CalcoloMano(); if(giocator

我正在开发一款纸牌游戏,我正在尝试在第二位玩家玩完他的牌后将其设置为不可见。 但即使我将ImageView设置为不可见,它也不会变为不可见。 这是我的密码:

    case HAND_CHECK:
                // give winned cards to the winning player
                giocatoreGiocante =tavoloDaGioco.CalcoloMano();
                if(giocatore1.GetCartaByIndex(0)==null&&giocatore2.GetCartaByIndex(0)==null){
                    gameState =GAME_STATE.CALCOLO_PUNTI;
                }
                else {
                    gameState = GAME_STATE.PESCA;
                }

                //playedCard is an ImageView 

                playedCard.setVisibility(View.INVISIBLE); //this is not execute
                Log.d("PUNTI", "GIOCATORE1="+giocatore1.GetPunti()+"GIOCATORE2="+giocatore2.GetPunti());
                UpdateGame();

                break;

playedCard保持可见,我希望它消失。

我用View解决了这个问题。Goe

关于
View呢。Goe
?with View.Goe仍然可见注释是您的代码是:playedCard是一个ImageView。这是否意味着playedCard不是ImageView?playedCard是ImageView您调试代码了吗?是
playedCard.setVisibility(视图.不可见)执行?如果是,则之后会调用
UpdateGame()。这会影响能见度吗?