Android examples for User Interface:View Size
set View Size by width and height
//package com.java2s; import android.view.View; import android.widget.FrameLayout.LayoutParams; public class Main { public static void setSize(View v, int w, int h) { LayoutParams lp = (LayoutParams) v.getLayoutParams(); lp.width = w;/* w ww. j ava2 s .c o m*/ lp.height = h; v.setLayoutParams(lp); } }