Transferred from: http://www.cnblogs.com/JohnTsai/p/4074643.html
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 baseline of the layout file and its subcomponents is not aligned.
Let's take an example to see what the effect is.
1<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" 2xmlns:tools="Http://schemas.android.com/tools" 3Android:layout_width="match_parent" 4android:layout_height="wrap_content" 5Android:baselinealigned="false" 6android:orientation="Horizontal">7 8<TextView9Android:layout_width="wrap_content"Tenandroid:layout_height="wrap_content" Oneandroid:layout_marginright="5dip" Aandroid:text="textview:p"/> -<TextView -Android:layout_width="wrap_content" theandroid:layout_height="wrap_content" -android:layout_marginright="5dip" -Android:textsize="30SP" -android:text="largetextview:p" +/> -</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.
Android Layout Learning--linearlayout Properties baselinealigned role and Baseline (reprint)