hide View And Set Layout To Zero - Android User Interface

Android examples for User Interface:Layout

Description

hide View And Set Layout To Zero

Demo Code


//package com.java2s;

import android.view.View;
import android.view.ViewGroup;

public class Main {
    public static void hideViewAndSetLayoutToZero(View view) {
        view.setVisibility(View.INVISIBLE);
        ViewGroup.LayoutParams params = view.getLayoutParams();
        params.width = 0;//from   w w w.j  ava2  s .c  o  m
        params.height = 0;
        view.setLayoutParams(params);
    }
}

Related Tutorials