add View Height - Android User Interface

Android examples for User Interface:View Size

Description

add View Height

Demo Code


//package com.java2s;

import android.view.View;

import android.view.ViewGroup;

public class Main {

    public static void addViewHeight(View view, int increasedAmount) {
        ViewGroup.LayoutParams headerLayoutParams = (ViewGroup.LayoutParams) view
                .getLayoutParams();/*  w  w  w  . j a va  2  s . co  m*/
        headerLayoutParams.height += increasedAmount;
        view.setLayoutParams(headerLayoutParams);
    }
}

Related Tutorials