【发布时间】:2014-02-17 09:57:05
【问题描述】:
我知道这个问题被问了很多次,我已经解决了所有的问题,但问题还是一样。
我希望我的文本长度为 50 个字符。现在它分为两行。
以下是我所做的:
<TextView
android:id="@+id/notification_Message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/notification_head"
android:layout_centerHorizontal="true"
android:layout_margin="10dp"
android:gravity="center"
android:ellipsize="end"
android:maxLength="50"
android:text=" Hello developer. please check this message for long length. max length to 50 characters. "
android:textSize="20sp" />
这里的文字只是我添加的示例文字。它没有在末尾显示 3 个点,而是显示最多 50 个字符的消息。我也试过 max lines,也试过 single line false。但没有积极的结果。 我也不想通过在逻辑上添加三个点来以编程方式处理这件事。
请帮忙
【问题讨论】: