Android examples for User Interface:View Size
set View Size
//package com.java2s; import android.view.View; import android.widget.FrameLayout; public class Main { private static void setViewSize(View view, int size) { FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) view .getLayoutParams();//w ww .j a v a 2 s . com params.width = size; params.height = size; view.setLayoutParams(params); view.requestLayout(); } }