【发布时间】:2011-11-18 02:46:56
【问题描述】:
我有一个简单的水平线性布局,里面有四个相同样式的 TextView。当 TextView 中的文本需要两行时,TextView 会变小:
我不明白为什么。有人可以帮忙吗?
谢谢
布局
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<TextView style="@style/compte_ba_cell"
android:background="@color/grey_header"
android:textStyle="bold" android:text="@string/montant" />
<TextView style="@style/compte_ba_cell"
android:background="@color/grey_header"
android:textStyle="bold" android:text="@string/origine" />
<TextView style="@style/compte_ba_cell"
android:background="@color/grey_header"
android:textStyle="bold" android:text="@string/echeance" />
<TextView style="@style/compte_ba_cell_last"
android:background="@color/grey_header"
android:textStyle="bold" android:text="@string/statut" />
</LinearLayout>
风格
<style name="compte_ba_cell">
<item name="android:layout_width">71.5dp</item>
<item name="android:layout_height">50dp</item>
<item name="android:textColor">#000000</item>
<item name="android:background">#FFFFFF</item>
<item name="android:layout_marginRight">2dp</item>
<item name="android:textSize">12sp</item>
<item name="android:typeface">serif</item>
<item name="android:gravity">center</item>
</style>
<style name="compte_ba_cell_last" parent="@style/compte_ba_cell">
<item name="android:layout_marginRight">0dp</item>
</style>
【问题讨论】: