In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Most people do not understand the knowledge points of this article "how to use ConstraintLayout layout in android", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to use ConstraintLayout layout in android" article.
1. To use ConstraintLayout, you need to introduce the following into the build.gradle of app:
Compile 'com.android.support.constraint:constraint-layout:1.0.2'
2. First, take a look at a simple xml and image effect:
It is not difficult for visitors to see that the four simple Textview distribution locations in xml take id as the first control of tv as the benchmark, the second control is below the first control, and all on the left side of the entire layout; the third control is on the lower left of the entire parent layout; and the fourth control is on the right side of the first control.
If you look closely, each Textview has similar properties:
For example, the first control:
App:layout_constraintTop_toTopOf= "parent"
Of the second control
App:layout_constraintTop_toBottomOf= "@ + id/tv1"
It literally means:
An edge of the control is aligned with an edge of a control.
For example, the first control aligns the upper part of the control with the upper part of the parent layout, which naturally makes the first control at the top left; the top of the second control is aligned with the bottom of the first control, the id=tv1, and the second control is naturally located directly below the first control. Others can follow suit.
Now let's stipulate a layout and try it again to make the most common layout.
The code is as follows:
App:layout_constraintTop_toTopOf= "parent" / app:layout_constraintRight_toLeftOf= "parent" android:layout_marginRight= "10dp" / app:layout_constraintTop_toBottomOf= "@ + id/tv1" / app:layout_constraintRight_toLeftOf= "parent" app:layout_constraintTop_toBottomOf= "@ + id/tv1" android:layout_marginRight= "10dp" / above is about how to use ConstraintLayout layout in android. I believe everyone has some understanding. I hope the content shared by the editor will be helpful to all of you. If you want to know more about the relevant knowledge, please 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.