Layout defines an activity UI framework, or a component of a UI.
The grammar is as follows:
? xml version= "1.0" encoding= "Utf-8"?><ViewGroupxmlns:android= "Http://schemas.android.com/apk/res/android"Android:id= "@[+][package:]id/resource_name"Android:layout_height=["Dimension"| "Fill_parent" | "Wrap_content"] android:layout_width=["Dimension"| "Fill_parent" | "Wrap_content"] [viewgroup-specific attributes]> <ViewAndroid:id= "@[+][package:]id/resource_name"Android:layout_height=["Dimension"| "Fill_parent" | "Wrap_content"] android:layout_width=["Dimension"| "Fill_parent" | "Wrap_content"] [view-specific attributes]> <Requestfocus/> </View> <ViewGroup> <View/> </ViewGroup> <includeLayout= "@layout/layout_resource"/></ViewGroup>
Viewgroup:linearlayout, Relativelayout, framelayout, etc.
View:textview, Button, checkbox, etc.
<REQUESTFOCUS/>: Specify focus
Android:id: The "@+id/xx" plus sign represents a new resource, and the compilation tool AAPT adds an integer variable to the R.java class as the resource ID. If you have defined an ID resource () has not been used, you can use Android:id to refer to a view.
You can also customize a view or ViewGroup
Summary of the Layout of Android-resource