gpt4 book ai didi

android - 如果它不适合 TextView 中的 1 行,如何在字符串末尾显示 ...?

转载 作者:行者123 更新时间:2023-11-29 18:19:49 32 4
gpt4 key购买 nike

我现在使用 android:maxLines="1"但我宁愿在这一行的末尾使用“...”。最好是淡化。 TextView 可以吗?

最佳答案

不仅可能,而且内置于框架中。

TextView 的 XML 标志是 android:ellipsize ,相关的TextView方法是setEllipsize .

关于android - 如果它不适合 TextView 中的 1 行,如何在字符串末尾显示 ...?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6131751/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com