I am a beginner, but I summarized it for personal study
The screen of the Android application is created by arranging the screen parts prepared by the Android SDK. This is to write the screen part tag in the .xml file. There are two main screen parts, ** view group ** and ** view **.
-The ** view group ** determines the layout of each screen, and is also called the ** layout component **. The following are the main layout parts
① **
-The ** view ** is the screen component itself and is also called the ** widget **.
・ The following is a typical view
① **
-On the Android screen, use layout parts and view parts in a hierarchical combination. -Layout parts determine the arrangement of screen parts, so use them including screen parts under them. Example)
activity_view_sample.xml
<LinearLayout>
<TextView/>
</LinearLayout>
-Tags that have child elements such as layout parts are surrounded by start tags and end tags, and many view parts do not have child elements, so do not write the end tag and insert a slash before the right parenthesis of the tag. Basically attribute-only tags
①android:id
・ Setting the id of screen parts -Write the ID when handling this part in the activity (Java program) ・ You can access the parts with the name "..." by writing as ** @ + id / ・ ・ ・ **. Example)
activity_view_sample.xml
<TextView
android:id="@+id/tvLabelInput"
②android:text
-Set the character string when the screen parts are displayed -Since the display character string is described in string.xml without directly describing it, the method of associating the character string described in string.xml with the screen parts is **@string / ・ ・ ・ **. Example)
activity_view_sample.xml
<TextView
android:text="@string/tv_msg"/>
string.xml
<string name="tv_msg">Please enter your name.</string>
③android:layout-width/height
・ Width represents the width of the part and height represents the height. ・ It is necessary to describe on all screen parts -Use numbers like ~ dp, or ** wrap_content ** or ** match_content ** ・ Wrap_content is automatically adjusted to the required size -Match_content extends to the full size of the parent part
④android:margin/padding
・ Both margin / padding represent margins ・ Margin is the margin on the outside of the screen, padding is the margin on the inside of the part