IT. Expert System.

Android Reference

View.MeasureSpec


android.view

Class View.MeasureSpec

  • Enclosing class:
    View


    public static class View.MeasureSpec
    extends Object
    A MeasureSpec encapsulates the layout requirements passed from parent to child. Each MeasureSpec represents a requirement for either the width or the height. A MeasureSpec is comprised of a size and a mode. There are three possible modes:
    UNSPECIFIED
    The parent has not imposed any constraint on the child. It can be whatever size it wants.
    EXACTLY
    The parent has determined an exact size for the child. The child is going to be given those bounds regardless of how big it wants to be.
    AT_MOST
    The child can be as large as it wants up to the specified size.
    MeasureSpecs are implemented as ints to reduce object allocation. This class is provided to pack and unpack the <size, mode> tuple into the int.
    • Field Summary

      Fields
      Modifier and Type Field and Description
      static int AT_MOST
      Measure specification mode: The child can be as large as it wants up to the specified size.
      static int EXACTLY
      Measure specification mode: The parent has determined an exact size for the child.
      static int UNSPECIFIED
      Measure specification mode: The parent has not imposed any constraint on the child.
    • Method Summary

      Methods
      Modifier and Type Method and Description
      static int getMode(int measureSpec)
      Extracts the mode from the supplied measure specification.
      static int getSize(int measureSpec)
      Extracts the size from the supplied measure specification.
      static int makeMeasureSpec(int size, int mode)
      Creates a measure specification based on the supplied size and mode.
      static String toString(int measureSpec)
      Returns a String representation of the specified measure specification.
    • Field Detail

      • UNSPECIFIED

        public static final int UNSPECIFIED
        Measure specification mode: The parent has not imposed any constraint on the child. It can be whatever size it wants.
        See Also:
        Constant Field Values
      • EXACTLY

        public static final int EXACTLY
        Measure specification mode: The parent has determined an exact size for the child. The child is going to be given those bounds regardless of how big it wants to be.
        See Also:
        Constant Field Values
      • AT_MOST

        public static final int AT_MOST
        Measure specification mode: The child can be as large as it wants up to the specified size.
        See Also:
        Constant Field Values
    • Constructor Detail

      • View.MeasureSpec

        public View.MeasureSpec()
    • Method Detail

      • makeMeasureSpec

        public static int makeMeasureSpec(int size,
                          int mode)
        Creates a measure specification based on the supplied size and mode. The mode must always be one of the following:
        Parameters:
        size - the size of the measure specification
        mode - the mode of the measure specification
        Returns:
        the measure specification based on size and mode
      • getMode

        public static int getMode(int measureSpec)
        Extracts the mode from the supplied measure specification.
        Parameters:
        measureSpec - the measure specification to extract the mode from
        Returns:
        UNSPECIFIED, AT_MOST or EXACTLY
      • getSize

        public static int getSize(int measureSpec)
        Extracts the size from the supplied measure specification.
        Parameters:
        measureSpec - the measure specification to extract the size from
        Returns:
        the size in pixels defined in the supplied measure specification
      • toString

        public static String toString(int measureSpec)
        Returns a String representation of the specified measure specification.
        Parameters:
        measureSpec - the measure specification to convert to a String
        Returns:
        a String with the following format: "MeasureSpec: MODE 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: 14792 / 248392015. Delta: 0.02895 с