how to use visible and invisible for a button in android

前端 未结 4 485
迷失自我
迷失自我 2021-02-04 06:29

I want to make a button invisible, when i click another button then the invisible button will become visible and then perform onClick() actions on the visible butto

4条回答
  •  臣服心动
    2021-02-04 06:56

    Here you go:

    Button theButton = (Button)findViewById(R.id.theButton);
    theButton.setVisibility(View.VISIBLE);
    theButton.setBackgroundColor(Color.TRANSPARENT);
    
    phoneButton.setOnClickListener(new OnClickListener()
    { 
     @Override
     public void onClick(View v)
     {
      // DO STUFF
     }
    });
    

提交回复
热议问题