request Layout Parent View - Android User Interface

Android examples for User Interface:Layout

Description

request Layout Parent View

Demo Code


//package com.java2s;

import android.view.View;

import android.view.ViewParent;

public class Main {
    public static void requestLayoutParent(View view, boolean isAll) {
        ViewParent parent = view.getParent();
        while (parent != null && parent instanceof View) {
            if (!parent.isLayoutRequested()) {
                parent.requestLayout();//  w w  w .j av a  2s .c  o  m
                if (!isAll) {
                    break;
                }
            }
            parent = parent.getParent();
        }
    }
}

Related Tutorials