如上图所示,蓝色边框所选中的控件是一个textview,在第一行到“负一层”明明就已经结束了,但后面却跟了几个明显的空格(连同下面几行都跟着空格),导致整个控件偏大,压缩了右边的控件,这是怎么回事呢?看上去有点像word那种“为了不让一个单词从中间被换行而宁愿让该行少放一个单词并且留白右侧”的做法。但我这里用的都是中文,为什么会有这种现象呢?
另外还有个问题,为什么我3个控件的layout_weight都设置为1了,可他们的大小却明显看起来不一样呢?
代码如下:
<LinearLayout
android:layout\_width\="match\_parent"
android:layout\_height\="120dp"
android:layout\_marginStart\="15dp"
android:layout\_marginTop\="15dp"
android:layout\_marginEnd\="15dp"
android:layout\_marginBottom\="15dp"
\>
<TextView
android:layout\_width\="wrap\_content"
android:layout\_height\="wrap\_content"
android:text\="下单日期:2019-11-30\\n\\n预计到货:\\n2019-12-02"
android:layout\_weight\="1"
android:singleLine\="false"
/>
<TextView
android:layout\_width\="wrap\_content"
android:layout\_height\="wrap\_content"
android:text\="松山湖深城投3号楼管井门扇(4191130-00249)\\n\\n\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\\n父项目:松山湖深城投\\n(0190831-00047)"
android:layout\_weight\="1"
android:singleLine\="false"
android:breakStrategy\="high\_quality"
/>
<TextView
android:layout\_width\="wrap\_content"
android:layout\_height\="wrap\_content"
android:text\="当前状态:已出货"
android:layout\_weight\="1"
android:singleLine\="false"
/>
</LinearLayout\>