Android: Last line of textview cut off

后端 未结 20 1311
北荒
北荒 2020-11-28 02:46

I have a horizontal LinearLayout containing a TextView followed by a Spinner next to it. This LinearLayout is dynamically

20条回答
  •  一生所求
    2020-11-28 03:05

    I've encountered the same cut-off issue as shown at the screenshot. It is caused by the baseline alignment in the horizontal LinearLayout. TextView and Spinner have different baselines due to font size difference. To fix the issue it is needed to disable baseline alignment for the layout by setting:

    android:baselineAligned="false"
    

    or in the code:

    layout.setBaselineAligned(false);
    

提交回复
热议问题