Get View offset Children Left And Right - Android User Interface

Android examples for User Interface:View Child

Description

Get View offset Children Left And Right

Demo Code


//package com.java2s;

import android.view.View;
import android.view.ViewGroup;

public class Main {
    public static void offsetChildrenLeftAndRight(ViewGroup viewGroup,
            int offset) {
        final int count = viewGroup.getChildCount();
        for (int i = 0; i < count; i++) {
            final View child = viewGroup.getChildAt(i);
            child.offsetLeftAndRight(offset);
        }/*from  w  w  w.j a v  a2 s. c  o  m*/
    }
}

Related Tutorials