【问题标题】:Replacing ellipsize with text in Android在Android中用文本替换椭圆大小
【发布时间】:2015-05-18 18:09:31
【问题描述】:

如果文本长度超过两行,我正在尝试将“阅读更多”添加到 textView 的末尾,但我很难这样做。我的 TextView 如下所示:

<TextView
        android:id="@+id/reviewText"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0.5"
        android:layout_marginLeft="1dp"
        android:text=""
        android:maxLines="2"
        android:ems="3"
        android:ellipsize="end"
        android:textColor="#FFFFFF" />

所以澄清一下,现在我得到三个点是因为椭圆形,但我真的希望它写“阅读更多”。

顺便说一句,我的软件支持 API 级别 14+。

【问题讨论】:

标签: android layout textview


【解决方案1】:

尝试添加以下两行:

abdroid:focusable="true"
android:focusableInTouchMode="true"

致您的TextView

【讨论】:

    猜你喜欢
    • 2014-05-23
    • 1970-01-01
    • 2017-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-17
    相关资源
    最近更新 更多