How do I get three buttons to align left, center, and right in the horizontal direction separately?
Android:layout_gravity= "left"
Android:layout_gravity= "Center_horizonal"
Android:layout_gravity= "Right"
How do I get the width and height of a component?
Call the View.measure method to measure the width and height of the component before calling View.getmeasuredwidth and View.getmeasuredheight (layout is also a subclass of view)
How do I make five buttons in a plum blossom-like arrangement?
http://blog.csdn.net/cjllife/article/details/8150604
How do I determine the location coordinates of a view?
int[] location = new Int[2];
View.getlocationinwindow (location);//Gets the absolute coordinates within the current window
View.getlocationonscreen (location);//get absolute coordinates across the screen
Location [0]--->x coordinates, location [1]--->y coordinates
How do I control control properties with Java code?
You first create a Layoutparams object, set the property with Layoutparams.addrules, and finally call the View.setparams method.
The use of tablelayout?
The tabular layout model manages child controls in the form of rows and columns, each of which behaves as a TableRow object, or, of course, a View object. TableRow you can add child controls, one for each column.
How will view?
View.setdrawingcacheenabled ()
View.getdrawingcache ()
How do I set the background color of a window to a gradient color?
GetWindow (). setbackgrounddrawable (gradientdrawable);
What does the Layout_weight attribute mean?
Http://mobile.51cto.com/abased-375428.htm
What are the effects of padding and Layout_margin properties?
padding: Sets the distance between the contents of the view and the left and right four directions from the edge.
Layout_margin: Sets the distance of the view's edge from other view or parent containers.
Dimensions of the unit of measurement?
PX, in, MM, PT (one point, 1/72 inch), DP, SP
The width of the entire screen is 160DP
SP is suitable for setting text size
The difference between layout_gravity and gravity?
layout_gravity Specifies the position of the current view in the parent container, gravity specifies the location of the content in the view.
How do I reuse a layout file?
Use <include> tags.
Layout optimization:
http://www.infoq.com/cn/articles/android-optimise-layout/
"Android Interview Treasure" study notes (Chapter II: Layout)