how can visible and invisible a textView permanently on android?

880 views Asked by At

I am working on an android app and I want to appear a textview as winker. Simplest way may be that visible and invisible permanently textView.I unfortunately am weak at most of technique. What should I do for having such graphics working.

4

There are 4 answers

0
Mohsin Bagwan On

If you want to dynamically do the following

pass the visibility flag to isTextVisble(flag) method //you need to pass the flag

private void isTextVisble(boolean isVisible) {
        if(isVisible)
            txtView.setVisibility(View.VISIBLE);
        else
             txtView.setVisibility(View.GONE);
        }
9
koutuk On
yourtextview.setVisibility(View.VISIBLE); //for visible

yourtextview.setVisibility(View.INVISIBLE); //for invisible

yourtextview.setVisibility(View.GONE); //for remove textview from Layout Spaces
0
Pratik Dasa On

If you want to Hide/Show your TextView then refer below part of code.

There are 3 methods to Hide/Show as below:

View.VISIBLE : This method will make your View Visible.

View.INVISIBLE : This method will make your view Invisible, but space will be occupied of that view, space will not be gone.

View.GONE : This method also make your View Invisible but space of that View will also be Invisible.

You can use that 3 methods like below:

//Instead of textView you can use any view like ListView, GridView, ImageView etc.

textview.setVisibility(View.VISIBLE);

textview.setVisibility(View.INVISIBLE);

textview.setVisibility(View.GONE);
0
Shivalingraju Shivu On

here you can use one button link on touch it will disapper like that you can create how manny buttons you want extra

/handle write click/ Button.setOnClickListener(new View.OnClickListener() {

        //@Override
        public void onClick(View v) {


            Text1.setVisibility(View.INVISIBLE);
            Text2.setVisibility(View.INVISIBLE);
            Text3.setVisibility(View.INVISIBLE);
            Text4.setVisibility(View.INVISIBLE);




            if(Text.length() != 0)
                deviceAddress = (byte) Integer.parseInt(Text.getText().toString());
            else
                deviceAddress = 00; /*default*/

            Text.setText(Integer.toString(deviceAddress));

        }
    });


    /*select the frequency*/
    freqText.setOnTouchListener(new View.OnTouchListener() {

        //@Override
        public boolean onTouch(View v, MotionEvent event) {
            // TODO Auto-generated method stub
            Text1.setVisibility(View.VISIBLE);
            Text2.setVisibility(View.VISIBLE);
            Text3.setVisibility(View.VISIBLE);
            Text4.setVisibility(View.VISIBLE);

            return false;
        }
    });


    /*set the selected value*/
    Text1.setOnTouchListener(new View.OnTouchListener() {

        //@Override
        public boolean onTouch(View v, MotionEvent event) {
            // TODO Auto-generated method stub
            Text.setText(freqText1.getText().toString());
            Text1.setVisibility(View.INVISIBLE);
            Text2.setVisibility(View.INVISIBLE);
            Text3.setVisibility(View.INVISIBLE);
            Text4.setVisibility(View.INVISIBLE);
            return false;
        }
    });