IT. Expert System.

Android Reference

ViewGroup.LayoutParams


android.view

Class ViewGroup.LayoutParams

  • Direct Known Subclasses:
    AbsListView.LayoutParams, AbsoluteLayout.LayoutParams, Gallery.LayoutParams, ViewGroup.MarginLayoutParams, ViewPager.LayoutParams, WindowManager.LayoutParams
    Enclosing class:
    ViewGroup


    public static class ViewGroup.LayoutParams
    extends Object
    LayoutParams are used by views to tell their parents how they want to be laid out. See ViewGroup Layout Attributes for a list of all child view attributes that this class supports.

    The base LayoutParams class just describes how big the view wants to be for both width and height. For each dimension, it can specify one of:

    • FILL_PARENT (renamed MATCH_PARENT in API Level 8 and higher), which means that the view wants to be as big as its parent (minus padding)
    • WRAP_CONTENT, which means that the view wants to be just big enough to enclose its content (plus padding)
    • an exact number
    There are subclasses of LayoutParams for different subclasses of ViewGroup. For example, AbsoluteLayout has its own subclass of LayoutParams which adds an X and Y value.

    Developer Guides

    For more information about creating user interface layouts, read the XML Layouts developer guide.

    • Field Detail

      • FILL_PARENT

        @Deprecated
        public static final int FILL_PARENT
        Deprecated.
        Special value for the height or width requested by a View. FILL_PARENT means that the view wants to be as big as its parent, minus the parent's padding, if any. This value is deprecated starting in API Level 8 and replaced by MATCH_PARENT.
        See Also:
        Constant Field Values
      • MATCH_PARENT

        public static final int MATCH_PARENT
        Special value for the height or width requested by a View. MATCH_PARENT means that the view wants to be as big as its parent, minus the parent's padding, if any. Introduced in API Level 8.
        See Also:
        Constant Field Values
      • WRAP_CONTENT

        public static final int WRAP_CONTENT
        Special value for the height or width requested by a View. WRAP_CONTENT means that the view wants to be just large enough to fit its own internal content, taking its own padding into account.
        See Also:
        Constant Field Values
      • width

        public int width
        Information about how wide the view wants to be. Can be one of the constants FILL_PARENT (replaced by MATCH_PARENT , in API Level 8) or WRAP_CONTENT. or an exact size.
      • height

        public int height
        Information about how tall the view wants to be. Can be one of the constants FILL_PARENT (replaced by MATCH_PARENT , in API Level 8) or WRAP_CONTENT. or an exact size.
    • Constructor Detail

      • ViewGroup.LayoutParams

        public ViewGroup.LayoutParams(Context c,
                              AttributeSet attrs)
        Creates a new set of layout parameters. The values are extracted from the supplied attributes set and context. The XML attributes mapped to this set of layout parameters are:
        Parameters:
        c - the application environment
        attrs - the set of attributes from which to extract the layout parameters' values
      • ViewGroup.LayoutParams

        public ViewGroup.LayoutParams(int width,
                              int height)
        Creates a new set of layout parameters with the specified width and height.
        Parameters:
        width - the width, either WRAP_CONTENT, FILL_PARENT (replaced by MATCH_PARENT in API Level 8), or a fixed size in pixels
        height - the height, either WRAP_CONTENT, FILL_PARENT (replaced by MATCH_PARENT in API Level 8), or a fixed size in pixels
      • ViewGroup.LayoutParams

        public ViewGroup.LayoutParams(ViewGroup.LayoutParams source)
        Copy constructor. Clones the width and height values of the source.
        Parameters:
        source - The layout params to copy from.
    • Method Detail

      • setBaseAttributes

        protected void setBaseAttributes(TypedArray a,
                             int widthAttr,
                             int heightAttr)
        Extracts the layout parameters from the supplied attributes.
        Parameters:
        a - the style attributes to extract the parameters from
        widthAttr - the identifier of the width attribute
        heightAttr - the identifier of the height attribute
      • resolveLayoutDirection

        public void resolveLayoutDirection(int layoutDirection)
        Resolve layout parameters depending on the layout direction. Subclasses that care about layoutDirection changes should override this method. The default implementation does nothing.
        Parameters:
        layoutDirection - the direction of the layout View.LAYOUT_DIRECTION_LTR View.LAYOUT_DIRECTION_RTL
      • debug

        public String debug(String output)
        Returns a String representation of this set of layout parameters.
        Parameters:
        output - the String to prepend to the internal representation
        Returns:
        a String with the following format: output + "ViewGroup.LayoutParams={ width=WIDTH, height=HEIGHT }"
      • onDebugDraw

        public void onDebugDraw(View view,
                       Canvas canvas)
        Use canvas to draw suitable debugging annotations for these LayoutParameters.
        Parameters:
        view - the view that contains these layout parameters
        canvas - the canvas on which to draw
      • sizeToString

        protected static String sizeToString(int size)
        Converts the specified size to a readable String.
        Parameters:
        size - the size to convert
        Returns:
        a String instance representing the supplied size


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 734 / . Delta: 0.02718 с