The android.widget.ImageView setVisibility method is used to set the visibility of an ImageView widget in an Android application. This method takes an integer argument that represents the visibility status of the ImageView. The integer values that can be used for the setVisibility method are:
- View.VISIBLE (0): The ImageView widget is visible - View.INVISIBLE (4): The ImageView widget is not visible, but still takes up space - View.GONE (8): The ImageView widget is not visible and does not take up space
Here are a few code examples demonstrating the use of the setVisibility method in Android applications:
// Set an ImageView widget to be invisible ImageView imageView = findViewById(R.id.my_image_view); imageView.setVisibility(View.INVISIBLE);
// Set an ImageView widget to be gone imageView.setVisibility(View.GONE);
// Set an ImageView widget to be visible imageView.setVisibility(View.VISIBLE);
This method is part of the android.view.View package library.
Java ImageView.setVisibility - 30 examples found. These are the top rated real world Java examples of android.widget.ImageView.setVisibility extracted from open source projects. You can rate examples to help us improve the quality of examples.