Android 使TextView可调整,并在末尾使用省略号显示在辅助功能设置中选中的最大字体大小 我有TextView和描述(从1行到10多行) 如果我将字体大小设置->辅助功能->字体大小更改为最大 我有一些空间,但不足以显示整个描述 我选择最多显示6行 我想在描述的最后省略号

Android 使TextView可调整,并在末尾使用省略号显示在辅助功能设置中选中的最大字体大小 我有TextView和描述(从1行到10多行) 如果我将字体大小设置->辅助功能->字体大小更改为最大 我有一些空间,但不足以显示整个描述 我选择最多显示6行 我想在描述的最后省略号,android,textview,android-textview-autosize,Android,Textview,Android Textview Autosize,TL;DR:如果文本太长,我希望在结尾处出现

TL;DR:如果文本太长,我希望在结尾处出现<6行和省略号。这不会发生(下图)。如何使
TextView
中的行号调整到文本长度,并始终在末尾添加省略号

你是如何处理这样的问题的?也许我应该从不同的角度来思考?哪一个?或者我试着同时吃蛋糕和吃蛋糕?

详情:

前面提到的
TextView
内部
ConstantLayout
(这就是为什么
android:layout\u width/height=“0dp”


 <TextView
        android:id="@+id/custom_list_item_description"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:ellipsize="end"
        android:maxLines="6"
        app:autoSizeMinTextSize="14sp"
        app:autoSizeTextType="uniform"
        <!-- some constraints -->
        tools:text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum." />