【问题标题】:increase the spacing between items in a List view in android增加android列表视图中项目之间的间距
【发布时间】:2011-07-09 20:55:53
【问题描述】:

我正在生成一个列表视图,如下所示:

setListAdapter(new ArrayAdapter<String>(this, R.layout.row, fileListS));

其中“行”为以下xml文件:

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:textSize="14sp">
</TextView>

有没有一种简单的方法可以增加生成的列表视图中项目列表之间的间距? 如果我使用 ListView 而不是 TextView 我想我可以使用:

 android:dividerHeight="10.0sp"

但是现在我使用 TextView 可以做什么?

谢谢,

TJ

【问题讨论】:

  • android:padding="100dip"
  • padding 只是增加了列表视图中每个框的大小,我想增加分隔列表视图中框的分隔线的高度。

标签: android listview


【解决方案1】:

你的意思是你想改变分隔线的厚度?

如果是这样,您可以在此处使用类似于问题/解决方案的可绘制对象

Using a Drawable Divider

Maybe a better answer

【讨论】:

  • 非常感谢您的回答。第二个链接效果很好。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-05-17
  • 1970-01-01
  • 1970-01-01
  • 2016-09-27
  • 2016-05-18
  • 1970-01-01
  • 2016-09-10
相关资源
最近更新 更多