Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is the advantage of using Space over View

I found that I'm using a View to make the space in my layouts and I thought to replace it with a Space.
So I asked myself if is there any gain to replace View with Space to make the space.

Space using the View widget :

<View
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        />

Space using the Space widget:

<Space
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        />

So... is there any gain to use the Space view instead of the View for spacing in a layout?

like image 972
Cool Avatar asked Aug 31 '16 16:08

Cool


People also ask

What are the advantages of going to space?

Overcoming the challenges of working in space has led to many technological and scientific advances that have provided benefits to society on Earth in areas including health and medicine, transportation, public safety, consumer goods, energy and environment, information technology, and industrial productivity.


1 Answers

For the most part, they're exactly the same. A Space sets its visibility to View#INVISIBLE by default so drawing operations are skipped. Other than that, there isn't much of a difference.

like image 105
DeeV Avatar answered Nov 09 '22 22:11

DeeV