set View Clip Children - Android User Interface

Android examples for User Interface:View Child

Description

set View Clip Children

Demo Code


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

public class Main {
    public static void setClipChildren(View targetView, boolean isClip) {
        ViewGroup parentView = (ViewGroup) targetView.getParent(), rootView = (ViewGroup) targetView
                .getRootView();/* w w w.j  a v  a 2 s  .com*/
        while (parentView != rootView) {
            parentView.setClipChildren(isClip);
            parentView = (ViewGroup) parentView.getParent();
        }
        rootView.setClipChildren(isClip);
    }
}

Related Tutorials