Android autoSizeText不是';不能正确显示
我有一个布局,利用了一个有几行的表。我试图使用API26的自动文本大小功能来确保文本保持在一行。我遇到的问题是,在我的列表中第一次显示时,文本被切成两半。如果我向下滚动列表,文本是好的,然后当我回到列表顶部时,文本是好的,但当它第一次显示时,它被切成两半。下面是我用于自动调整大小的代码Android autoSizeText不是';不能正确显示,android,autosize,android-textview-autosize,Android,Autosize,Android Textview Autosize,我有一个布局,利用了一个有几行的表。我试图使用API26的自动文本大小功能来确保文本保持在一行。我遇到的问题是,在我的列表中第一次显示时,文本被切成两半。如果我向下滚动列表,文本是好的,然后当我回到列表顶部时,文本是好的,但当它第一次显示时,它被切成两半。下面是我用于自动调整大小的代码 <TableLayout android:layout_width="fill_parent" android:layout_
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"
android:gravity="center">
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minHeight="30dp"
android:gravity="center">
<TextView
android:id="@+id/AITAsymbol"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoSizeMaxTextSize="30dp"
android:autoSizeMinTextSize="24dp"
android:autoSizeStepGranularity="2dp"
android:autoSizeTextType="uniform"
android:textAlignment="center"
android:textColor="#000000" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center">
<TextView
android:id="@+id/received"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textColor="#ffffff" />
</TableRow>
</TableLayout>
关于如何在Android中使用自动调整大小功能,我是否遗漏了一些内容?您需要保持版面宽度或版面高度固定,以使自动文本调整大小属性正常工作。谢谢,将textview height属性更改为静态高度已经解决了这个问题。