Android examples for User Interface:View Size
set Width For View
//package com.java2s; import android.view.View; import android.view.ViewGroup; public class Main { public static void setWidthForView(View view, int widthInPixels) { ViewGroup.LayoutParams layoutParams = view.getLayoutParams(); layoutParams.width = widthInPixels; view.setLayoutParams(layoutParams); }//from w w w . ja va 2s . c om }