即使我将ImageView设置为不可见,它也不会将其设置为不可见

时间:2019-04-20 14:12:53

标签: java android

我正在开发一种纸牌游戏,我试图在第二位玩家玩完纸牌后将其设置为不可见。 但是,即使我将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仍然可见,我希望它消失。

1 个答案:

答案 0 :(得分:0)

我用View.GONE解决了这个问题

相关问题