print ViewGroup Child Rect - Android android.view

Android examples for android.view:ViewGroup

Description

print ViewGroup Child Rect

Demo Code

import android.content.Context;
import android.graphics.Rect;
import android.util.Log;
import android.view.MotionEvent;
import android.view.ViewGroup;

public class Main{

    public static void printChildRect(ViewGroup parent, final String tag) {
        for (int i = 0; i < parent.getChildCount(); ++i) {
            Rect childRect = new Rect();
            parent.getChildAt(i).getHitRect(childRect);
        }//from  w  ww. j  a  va  2 s.co  m
    }

}

Related Tutorials