In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you the "sample analysis of XML layout files", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "sample analysis of XML layout files" this article.
XML layout file
The layout file in xml format is stored in the folder res/layout
The main layout methods are LinearLayout (linear layout), TableLayout (table layout) and RelativeLayout (relative layout).
Of course, there are AbsoluteLayout, (absolute layout), FrameLayout (frame layout) and so on.
They can also achieve a better interface effect through nesting.
I sorted out the commonly used attributes according to my personal understanding.
It may not be scientific, but I think it's practical.
Control as a whole:
Android:id address
Android:width width
Android:height height
Android:layout_width width (fill_parent/wrap_content)
Android:layout_height height (fill_parent/wrap_content)
Android:layout_margin (Left/Top/Right/Bottom) outer margin (* dip)
Android:layout_weight specific gravity
Control content:
Android:text text content
Android:textSize text size
Basic location of android:gravity content
Android:background background color (RBG)
Android:padding (Left/Top/Right/Bottom) inside margin (* dip)
Android:singleLine content peer display (true/false)
Relative layout:
Whose top is aligned under the android:layout_above (id)
Whose bottom is the top of the android:layout_below aligned with (id)
Whose left is the right side of the android:layout_toLeftOf aligned with (id)
Whose right is the left side of the android:layout_toRightOf aligned with (id)
Whose top of the android:layout_alignTop is aligned with (id)
Whose underside is aligned under the android:layout_alignBottom (id)
Whose left is the android:layout_alignLeft left aligned with (id)
Whose right is the android:layout_alignRight right aligned with (id)
Align the android:layout_alignParentTop to the top of the parent control (true/false)
Align the lower edge of the android:layout_alignParentBottom with the lower edge of the parent control (true/false)
Align the left side of the android:layout_alignParentLeft with the left side of the parent control (true/false)
The right side of the android:layout_alignParentRight is aligned with the right side of the parent control (true/false)
Android:layout_centerInParent centered relative to parent control (true/false)
Android:layout_centerHorizontal is centered horizontally relative to the parent control (true/false)
Android:layout_centerVertical is centered vertically relative to the parent control (true/false)
~
Here is the registration page that I just finished.
The above is all the contents of the article "sample Analysis of XML layout Files". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.