【问题标题】:Listview in Scrollview which has multiline text具有多行文本的 Scrollview 中的 Listview
【发布时间】:2016-01-04 12:41:06
【问题描述】:

listview 中有一个 textview,而 textview 的文本太长,只有 3 或 4 行。在这种情况下,列表视图不会显示所有项目。有任何解决方案吗?

【问题讨论】:

  • Listview in Scrollview 非常糟糕的主意...
  • 这样,当你点击TextView时,你可以显示完整的文本,默认显示一行,末尾带有点。
  • 也许你可以使用wrap_content 代替textView 来避免scroll...
  • @FrankN.Stein-如果您有任何其他不使用滚动视图中的列表视图的想法。请告诉我。
  • @AnithaManikandan-我目前的问题是我有 3 个列表视图,在列表视图之间我有另一个布局。有什么解决方案吗?

标签: android android-listview textview android-scrollview


【解决方案1】:

根据您的要求保持 Textviews 的最大长度。 例如如下:

   <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New Text"
        android:id="@+id/textView"
        android:ellipsize="end"
        android:maxLines="2"
    /> 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-11-18
    • 1970-01-01
    • 1970-01-01
    • 2013-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多