【发布时间】:2011-08-08 17:56:45
【问题描述】:
我有一个TextView,可以动态调整大小(我使用setTextSize())。它在 Android 2.2 上正确地扩展和收缩了它的界限。但是在Android 3.1上,当文字变小时,区域的高度并没有缩小。
Here is the short video 证明了这一点。
布局只是简单的垂直LinearLayout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="0dip">
...
<TextView
android:id="@+id/track_number"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/tcTrackNo"
android:padding="5dp" />
...
<style name="tcTrackNo" parent="@android:style/TextAppearance.Small">
<item name="android:textColor">@color/track_number</item>
</style>
那么,为了使TextView 在 Honeycomb 上的字体大小相应地减小其高度,还需要做些什么?
PS。同样,在 Android 2.2 上,文本区域会折叠到最小高度,没有任何问题。 The video how it's intended to work.
【问题讨论】: