change View Height - Android User Interface

Android examples for User Interface:View Size

Description

change View Height

Demo Code


//package com.java2s;
import android.view.View;
import android.view.ViewGroup.LayoutParams;

public class Main {

    public static void changeH(View v, int H) {
        LayoutParams params = (LayoutParams) v.getLayoutParams();
        params.height = H;/*from  w  ww  .j  av a 2s.  com*/
        v.setLayoutParams(params);
    }
}

Related Tutorials