Android examples for User Interface:View Position
set View Absolute Position And Size
//package com.java2s; import android.view.View; import android.widget.FrameLayout.LayoutParams; public class Main { public static void setAbsolutePositionAndSize(View v, int x, int y, int w, int h) { LayoutParams lp = (LayoutParams) v.getLayoutParams(); lp.leftMargin = x;/*from ww w .j a v a2s. c o m*/ lp.topMargin = y; lp.width = w; lp.height = h; v.setLayoutParams(lp); } }