Question:
In the act of developing an application, I came across the following warning:
Set android:baselineAligned="false" on this element for better performance
What is the baselineAligned
purpose? When should I use it?
Answer:
android:baselineAligned
: When set to false
, prevents the layout from aligning its children's baselines.
When using a horizontal LinearLayout
, items are aligned by the position of their base line of text (the first line of the first element in the list – from the top or from the left – is considered the reference line). This is so that people don't have to look up and down when reading the text of neighboring elements. To disable this property set android:baselineAligned=”false”
in XML layout.