Android class description-measurespec

Source: Internet
Author: User

Translated from:Http://developer.android.com/reference/android/view/View.MeasureSpec.html

Inheritance relationship

Java. Lang. Object

| _____ Android. View. View. measurespec

Class Overview

The measurespec class encapsulates the layout requirements that are passed from the parent container to the Child view. Each measurespec object represents a width and/or height requirement, which consists of a size and a mode. The mode is as follows:

Unspecified

The parent container does not impose any constraints on the Child view. It can be any size it wants.

Exactly

The parent container determines the exact size of the Child view. Subviews are given their boundaries, regardless of the actual size of the view.

At_most

The size of a child view can be as large as the size specified by the Child view. This class provides a method to compress <size, mode> and decompress it into integers.

Constants

Int

At_most

Measurement specification mode: The child view can be as large as the size specified by it.

Int

Exactly

Measurement specification mode: the parent container determines the precise size of the Child view.

Int

Unspecified

Measurement specification mode: the parent container does not forcibly restrict the size of the Child view.

 

Public Constructors

 

View. measurespec()

 

Public Methods

static int

getmode (INT measurespec)

extract measurement modes from the provided measurement specifications.

parameter

measurespec: Measure specifications to extract measurement modes

return value

unspecified, at_most or exactly

static int

getsize (INT measurespec)

extract dimensions from provided measurement specifications

parameter

measurespec to extract measurement specifications for measurement dimensions

return value

dimensions defined in pixels in the provided measurement specifications.

static int

makemeasurespec (INT size, int Mode)

creates a measurement specification based on the specified size and mode. The mode must be one of the following values:

unspecified

exactly

at_most

parameter

siz E measurement specification size

mode: standard mode

return value

A measurement specification based on the specified size and mode.

Static string

Tostring (INT measurespec)

Returns the string representation of the specified measurement specification.

Parameters

Measure specification for converting measurespec to a string

Return Value

A string in the format of "measurespec: mode size.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.