我正在尝试调整 TextView 中的包装文本以适应其范围 . 我已经使用here中的源创建了一个新类,我已将其添加到我的布局中:

<com.util.AutoResizeTextView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginLeft="10dp"
                android:layout_alignLeft="@id/ivBulb"
                android:layout_marginTop="5dp"
                android:layout_marginBottom="80dp"
                android:layout_below="@id/ivBulb"
                android:layout_marginRight="10dp"
                android:id="@+id/textP"
                android:ellipsize="none"
                android:fontFamily="sans-serif"
                android:textColor="#000"
                android:textSize="100sp"/> <!--maximum size -->

应该在 TextView 中显示的文本是这样的:

The sunset filled the entire sky with the deep color of rubies, setting the clouds ablaze. The waves crashed and danced along the shore, moving up and down in a graceful and gentle rhythm like they were dancing.

有些文本可以是多行,但有些文本总是相同的:(我添加了一个 ScrollView 以便能够显示所有文本,但我想保留 TextView 和文本来调整大小

我是Android开发的新手,所以请保持温和 .