The blog has been created for a year, has not been used up, quite ashamed. Recently, the impulse to write a blog, more frightening is that the impulse seems to be more ferocious than the primitive force in my body. Thus, this blog was born quietly. Needless to say, get to the point--the first knowledge of Android.
This blog starts with the most basic knowledge.
- View: There are many kinds of view, display the text of the TextView, display the image of the ImageView, button buttons and so on (the content is too many, not listed).
- Layout: Consists of all view on the screen. Divided into LinearLayout (linear layout) and relativelayout (relative layout).
-
- LinearLayout Unique Code:
Android:orientation=horizontal/vertical //Overall layout horizontal/Overall layout vertical android:layout_weight= "1" //(weight set to 1) the greater the weight, The more space you get. Height (height) or weight (width) should be set to 0DP first
... ...
- Relativelayout Unique Code:
android:layout_alignparenttop= "True/false"//align with parent view Upper edge android:layout_alignparentbottom= "true/false"// Aligns with the parent view bottom edge android:layout_alignparentleft= "true/false"//Align to the left edge of the parent view android:layout_alignparentright= "True/false"// Aligns to the right edge of the parent view android:layout_centerhorizontal= "True/false"//view horizontally centered place android:layout_centervertical= "true/false"// View Vertical Center Placement
... ...
In addition, relative layouts add controls to the upper-left corner of the screen by default.
3. Each control must have a width and height.
For example:
4. IDE: Integrated development environment.
5. ID: Specifies the unique identity of the control, which is saved in the R file.
6. Inner Margin & margin:
First knowledge of Android