Wednesday, 29 July 2015

android layout GONE VS. INVISIBLE to hide a component on the page

if you want to hide a component on your page you can:

button.setVisibility(View.INVISIBLE)

OR:

button.setVisibility(View.GONE)


The difference is

intGONEThis view is invisible, and it doesn't take any space for layout purposes.
intINVISIBLEThis view is invisible, but it still takes up space for layout purposes.


http://developer.android.com/intl/ko/reference/android/view/View.html




1 comment: