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_CONTENT
Or fixed-size pixels
HeightMATCH_PARENT
,WRAP_CONTENT
Or 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