Difference between setVisible_INVISIBLE and setVisible_GONE

Though both setVisible INVISIBLE and setVisible GONE appear to achieve similar tasks, but both are different.

With setVisible INVISIBLE object remains on screen but is not seen. Whereas with setVisible GONE, object disappears from screen.

Here is an illustration. Suppose there are six imageviews arranged horizontally inside a linear horizontal as shown below.

Now in the Logic section, if the fourth image is set VISIBLE and rest of the images are set INVISIBLE,
the fourth image will be visible at it's position and rest of the images will disappear, as shown in the image below.

Whereas if the fourth image is set VISIBLE and rest of the images are set GONE,
all other images will disappear and fourth image will shift to left to occupy the initial available space on left side, as shown in the image below.

It appears to be a simple difference but it is important to be aware of this as it can be useful in fixing many bugs in android games and apps.

Komentar

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

How to enable download in webview in Sketchware apps?

TextInputLayout in Sketchware

Create Stopwatch App in Android using Sketchware

How to integrate Admob Ads in Sketchware project using AIDE?

How to find and​ highlight a word in a text field in Sketchware?

Code for implementing Notifications in Sketchware

A Flash Light App in Sketchware

Create a Stopwatch App using Chronometer in Sketchware

Create app to save all passwords, protected using voice key