I believe you are quite familiar with linearlayout, but do you know the properties of baselinealigned?
The official Android documentation describes this:
So what exactly is this property for?
baselinealigned: Baseline alignment.
The first thing to explain is the baseline, which is not common in Chinese, but is very common in other countries where the alphabet is written.
As shown, the red line is the baseline (baseline), is not very familiar with, this is we often write English in the four line of the third article.
What is the baselinealigned for? According to the official documentation, Baselinealigned is set to True by default, and when set to false,
The layout file and its child's baseline are not aligned.
Let's take an example to see what the effect is.
1 <linearlayout xmlns:android= "http://schemas.android.com/apk/res/android" 2 xmlns:tools= "/http/ Schemas.android.com/tools "3 android:layout_width=" match_parent "4 android:layout_height=" Wrap_content "5 android:baselinealigned= "false" 6 android:orientation= "Horizontal" > 7 8 <textview 9 Android:layout_width= "Wrap_content" ten android:layout_height= "Wrap_content" android:layout_ marginright= "5dip" android:text= "textview:p"/>13 <textview android:layout_width= "wrap _content " android:layout_height=" wrap_content " android:layout_marginright=" 5dip " android: Textsize= "30SP" android:text= "largetextview:p" />20 </LinearLayout>
This is when the baselinealigned value is set to False, that is, not aligned. Look at the running effect:
Change the baselinealigned value to true.
See, the difference is obvious, so it is good to understand the role of baselinealigned. In fact, this is not difficult, but I think whether it is difficult, as long as do not understand, you should think more, think about why.
The function and baseline of LinearLayout attribute baselinealigned