Android examples for User Interface:Layout
set View Relative Layout Size
//package com.java2s; import android.view.View; import android.widget.RelativeLayout; public class Main { public static void setRelativeLayoutSize(View v, int width, int height) { RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) v .getLayoutParams();/*from ww w. ja v a2 s. c o m*/ if (lp == null) { lp = new RelativeLayout.LayoutParams(width, height); } else { lp.width = width; lp.height = height; } v.setLayoutParams(lp); } }