Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am trying to turn some items visibility off when submitting a high score.

I have the following code but it does not appear to work. Any suggestions?

mSignText = (EditText) findViewById(R.id.sign);

submitBtn = (ImageView) this.findViewById(R.id.submitbtn);

mSignText.setVisibility(View.GONE);

submitBtn.setVisibility(View.GONE);

share|improve this question

1 Answer 1

For visibility, you must use setVisibility as you have done:

  • View.VISIBLE
  • View.INVISIBLE
  • View.GONE

GONE set the view as invisible, and it doesn't take any space for layout purposes.

http://developer.android.com/reference/android/view/View.html#setVisibility

share|improve this answer
    
I tried both GONE and INVISIBLE and neither one seem to work. –  Adam Coburn Oct 13 '10 at 22:43
    
You must have another problem. I use these functions without problem. Are you sure you have unique ids for each row ? Use this code not in the list but with one unique EditText or ImageView in your Layout. –  Ellis Oct 13 '10 at 23:00
    
I also wrapped the two items with the unique LinearLayout and tried that to no avail. –  Adam Coburn Oct 13 '10 at 23:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.