【问题标题】:ListView. Hot to highlight whole listview item when touching on it列表显示。触摸时突出显示整个列表视图项目
【发布时间】:2014-01-14 00:47:27
【问题描述】:

ListView 的项目包含TextView。 当您触摸 listview 项目并按住它的手指时,listview 项目会突出显示一点。

但如果 textview 仅包含几个字母 - 并非所有行都突出显示。

是否有任何简单的解决方案(一些 xml 属性等)来突出显示整行?

【问题讨论】:

  • 你有列表视图的xml代码吗?
  • 给我看看你的listview代码..
  • 试着让你的TextView 宽度fill_parent 然后检查@vetalitet

标签: android listview


【解决方案1】:
Hi Set This Code In Your Xml Of ListView
=================================
<ListView android:id="@+id/list1"
         android:layout_width="match_parent"
        android:layout_height="match_parent"/>

【讨论】:

  • 是的。这就是我想要的。我全神贯注于 ListView 项目,完全忘记更改父项的任何属性。谢谢!
  • 永远欢迎!它发生过几次。
【解决方案2】:

您尝试使 listview 宽度 android:layout_width="fill_parent" 。如果您使用自定义适配器(图像和文本)-make layout width size-fill parent or match parent

【讨论】:

    【解决方案3】:

    在Listview的xml中设置父Layout标签的android:layout_width属性为fill_Parent。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-21
      • 2019-09-03
      • 2011-08-09
      • 2012-06-21
      • 1970-01-01
      • 2013-12-22
      • 1970-01-01
      • 2012-05-09
      相关资源
      最近更新 更多