dump view information to a String - Android User Interface

Android examples for User Interface:View

Description

dump view information to a String

Demo Code


//package com.java2s;
import android.view.View;

public class Main {
    public static final String dump(View view) {
        if (view == null)
            return "";
        return "[" + view.getLeft() + "," + view.getTop() + ", w="
                + view.getWidth() + ", h=" + view.getHeight() + "] mw="
                + view.getMeasuredWidth() + ", mh="
                + view.getMeasuredHeight() + ", scroll["
                + view.getScrollX() + "," + view.getScrollY() + "]";
    }//from  w ww.  ja  v a2 s. c  o  m
}

Related Tutorials