Android examples for User Interface:View Margin
get View Horizontal Margin Sum
//package com.java2s; import android.view.View; import android.view.ViewGroup; public class Main { public static int getHorizontalMarginSum(View v) { ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams) v .getLayoutParams();//from www. j a v a2 s . co m return mlp.leftMargin + mlp.rightMargin; } }