【问题标题】:Android Listview item's borderAndroid Listview 项目边框
【发布时间】:2013-11-27 03:31:52
【问题描述】:

我有一个ListView,并且在我的列表中显示了一个ArrayList 的对象。每个列表项都是一个TableLayoutTableLayout 有一个 TableRowTableRow 有 3 个 TextViews。

我想为TextViews 显示一个边框,以便我的ListView 看起来像网格。

谁能告诉我如何在TableRow 中为TextViews 设置边框?

【问题讨论】:

标签: android listview textview tablelayout tablerow


【解决方案1】:

请尝试使用以下代码。

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="10dp"
android:shape="rectangle" >

  <stroke
    android:width="1dp"
    android:color="#C0C0C0" />

<solid android:color="#C0C0C0" />

<corners
    android:bottomLeftRadius="5dp"
    android:bottomRightRadius="5dp"
    android:topLeftRadius="5dp"
    android:topRightRadius="5dp" />
 </shape>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-02-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-12
    • 2013-08-01
    • 2012-06-22
    相关资源
    最近更新 更多