我有一个Android TextView,其视图本身被限制为四行。如果文本超出此限制,我希望视图的结尾以类似.. <之类的结尾 - 通知此处有更多文本,以便您可以单击并以全屏方式打开。不只是在句子中间突然停下来。有没有快速解决这个问题?Android TextView
5
A
回答
3
在布局XML文件中使用android:ellipsize="end"
属性。它可能在句子中间停下来,但最后会有一个省略号(...)。
1
转到布局文件,其中包含此的TextView和地点如下属性
android:ellipsize="end"
有4个选项。开始,结束,中间或选取框。由于你想在最后点使用“结束”值
0
android:maxLines="4"
android:ellipsize="end"
相关问题
- 1. Android TextView
- 2. Android TextView - sendAfterTextChanged
- 3. Android TextView Wrap
- 4. Android textView滚动
- 5. Android XML Textview Bold
- 6. Android TextView settext()Nullpointer
- 7. Android Textview变黑
- 8. 动态TextView | Android
- 9. android textview size huge
- 10. Android Studio,Sql,TextView
- 11. Android TextView重力
- 12. Linkify in android TextView
- 13. Android TextView Marqee
- 14. android textview arrays
- 15. Android - 大TextView dyanamically
- 16. Android - TextView滚动
- 17. Android TextView更新
- 18. Android textview缺少
- 19. TextView in android
- 20. Android AutoComplete TextView
- 21. Android TextView问题
- 22. Android TextView右侧
- 23. onclicklistener textView android
- 24. Android TextView权重
- 25. Android分组TextView
- 26. Android TextView格式化
- 27. spannable on android for textView
- 28. Android TextView换行符
- 29. Android - TextView不显示
- 30. Android onLongClick TextView的bug
嗨!谢谢!现在唯一的问题是,无论如何,文本都会在两行后结束。已经设置android:maxLines =“4”。任何想法?没有你提供的代码最多四行。 – KimAMartinsen 2010-05-29 11:55:18
嗯...基于文档,它看起来像'android:ellipsize'可能是为单行而不是多行设计的。不过,我不知道为什么你会得到两行输出,而不是1或4。你有'android:minLines'或'android:minHeight'定义吗? – CommonsWare 2010-05-29 12:04:35
不,只设置maxLines。试了你给的两个命令,但仍然只有两行。 Tricky这一个.. – KimAMartinsen 2010-05-29 12:21:27