add View Width - Android User Interface

Android examples for User Interface:View Size

Description

add View Width

Demo Code


//package com.java2s;

import android.view.View;

import android.view.ViewGroup;

public class Main {

    public static void addViewWidth(View view, int increasedAmount) {
        ViewGroup.LayoutParams headerLayoutParams = (ViewGroup.LayoutParams) view
                .getLayoutParams();/*from w  ww  .ja v a  2 s.  c  om*/
        headerLayoutParams.width += increasedAmount;
        view.setLayoutParams(headerLayoutParams);
    }
}

Related Tutorials