views:

30

answers:

0

I'm trying to disable a TextView within a ViewFlipper via setVisibility to GONE and cannot get it to act like I'm wanting. My code:

switch(index) {        
    case 0:
        //Do Stuff
     findViewById(R.id.o2).setVisibility(8);
     findViewById(R.id.o3).setVisibility(8);
     break;
    case 1:
        //Do Stuff
     findViewById(R.id.o3).setVisibility(8);         
     break;
    case 2:
        //Do Stuff
     break;
    }

my XML

<ViewFlipper android:id="@+id/oFlipper"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:flipInterval="1000"
     android:inAnimation="@anim/push_up_in"
     android:outAnimation="@anim/push_up_out">
        <TextView android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:gravity="center_horizontal"
         android:textSize="26sp"
         android:text="Opponents:"/>
        <TextView android:id="@+id/o1"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:gravity="center_horizontal"
         android:textSize="26sp"
         android:visibility="gone"/>
        <TextView android:id="@+id/o2"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:gravity="center_horizontal"
         android:textSize="26sp"
         android:text="2"/>
        <TextView android:id="@+id/o3"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:textSize="26sp"
            android:text="3"/>
 </ViewFlipper>

I've tried the code before and after .startFlipping() to no avail. It appears that the TextView is gone for one view flip and then reappears. But even when hardcoded to GONE in the XML file the view is simply blank rather than shifting the other views up in its place. I basically just want the TextView to go away completely. Is there any way to accomplish this?