Android Chinese API documentation (45) -- AbsoluteLayout. LayoutParams

Source: Internet
Author: User

 

Preface

This chapter is about android. widget. AbsoluteLayout. LayoutParams. The version is Android 2.2 r1 and translated from "sugar". Thanks again "sugar "! I look forward to your participation in Android Chinese API translation, contact me over140@gmail.com.

 

Statement

You are welcome to repost, but please keep the original source of the article :)

Blog Garden: http://www.cnblogs.com/

Android Chinese translation group: http://code.taobao.org/project/view/404/

 

Body

I. Structure

    Public static class AbsoluteLayout. LayoutParams extends ViewGroup. LayoutParams

 

Java. lang. Object

Android. view. ViewGroup. LayoutParams

Android. widget. AbsoluteLayout. LayoutParams

 

Ii. Overview

The layout information of each child element is associated with the absolute layout. See the list of child view attributes supported by this class in absolute layout attributes. (Note: The layout of AbsoluteLayout is basically the same as that of the Left and Top settings UI elements in Windows programming that we are very familiar .)

 

3. Fields

Public int x

X horizontal position in the child element of the View Group.

 

Public int y

Y vertical position of the child element in the View Group.

 

Iv. Constructor

Public AbsoluteLayout. LayoutParams (int width, int height, int x, int y)

Create a new layout parameter with the specified width, height, and position.

Parameters:

WidthMATCH_PARENT,WRAP_CONTENTOr fixed-size pixels

HeightMATCH_PARENT,WRAP_CONTENTOr fixed-size pixels

X position of the child element

Y position of the Y sub-element

 

Public AbsoluteLayout. LayoutParams (Context c, AttributeSet attrs)

Create a set of new layout parameters and set them through context-extracted attribute values. The settings for ing XML attributes to this layout parameter are as follows:

·layout_x: X position of the child element

·layout_y: Y position of the child element

·All XML attributes from ViewGroup. LayoutParams

Parameters:

C. Context.

Attrs extracts layout parameter values from attribute settings.

 

Public AbsoluteLayout. LayoutParams (ViewGroup. LayoutParams source)

(Translator's note: According to ViewGroup. LayoutParams, the layout parameters are instantiated and can be seen from the source code:

   

 

V. Public Methods

Public String debug (String output)

Returns the string representation of the configured layout parameter.

Parameters

Output is used to internally represent the preset string

Return Value

Returns the following string: Output + "ViewGroup. LayoutParams = {width = WIDTH, height = HEIGHT }"

6. Related Articles

Android Chinese API (37) -- AbsoluteLayout

Related Article

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.