android平板Listview内边距,Android中的ListView项目的边距

我试图(无效)在我的ListView项目中添加边距。我尝试向下面的RelativeLayout添加边距值,但无论我做什么,我似乎得到的是每个项目之间的1px线。

我真正想要的是在每个项目上有圆角,一个1px的黑色边框和一个3-5px的边距,顶部和右边,但是现在我只需要为每个项目提供一个边距:-)

如何实现我的目标?只是现在的边缘… 😉

这里是我有:

更新:我已经更新了下面的xml删除主要布局和片段布局。我也更新了ListView项目布局,我现在已经更接近我想要但仍然不完美。屏幕截图也被添加

listview项目布局xml

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:paddingLeft="@dimen/matchMargin"

android:paddingRight="@dimen/matchMargin"

android:paddingTop="@dimen/matchMargin" >

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:background="#cfcfcfcf" >

android:id="@+id/matchKampstart"

layout="@layout/kampstart_layout" />

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/matchKampstart"

android:layout_marginTop="@dimen/belowKampstartMargin" >

android:id="@+id/tournamentImageView"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center_vertical"

android:layout_marginRight="2dp"

android:adjustViewBounds="true"

android:contentDescription="@string/tournamentImageViewContentDescription"

android:gravity="left"

android:src="@drawable/sofabold_launcher" />

android:id="@+id/homeTeamImageView"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center_vertical"

android:layout_marginRight="2dp"

android:adjustViewBounds="true"

android:contentDescription="@string/homeTeamImageViewContentDescription"

android:src="@drawable/sofabold_launcher" />

android:id="@+id/homeTeam"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center_vertical"

android:layout_marginRight="2dp"

android:text="@string/home"

android:textSize="14sp"

android:textStyle="bold" />

android:id="@+id/dash"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center_vertical"

android:layout_marginRight="2dp"

android:gravity="center"

android:text="@string/dash"

android:textSize="12sp"

android:textStyle="bold" />

android:id="@+id/awayTeamImageView"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center_vertical"

android:layout_marginRight="2dp"

android:adjustViewBounds="true"

android:contentDescription="@string/awayTeamImageViewContentDescription"

android:src="@drawable/sofabold_launcher" />

android:id="@+id/awayTeam"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center_vertical"

android:gravity="center"

android:text="@string/away"

android:textSize="14sp"

android:textStyle="bold" />

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_alignParentRight="true"

android:layout_below="@id/matchKampstart"

android:layout_marginTop="@dimen/belowKampstartMargin" >

android:id="@+id/tvChannelImageView"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:adjustViewBounds="false"

android:contentDescription="@string/tvChannelImageViewContentDescription"

android:gravity="right"

android:src="@drawable/sofabold_launcher" />

这给了我以下,你会注意到每个项目的右边和左边的一条很小的线。我也想摆脱。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值