如何在android中的tablelayout中为tablerow提供边框? [英] how to give border for tablerow in tablelayout in android?

查看:34
本文介绍了如何在android中的tablelayout中为tablerow提供边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 TableLayout 中的 TableRow 周围显示边框.

I need to show border around TableRow in TableLayout.

我该怎么做???

推荐答案

我给出一个想法 -> 使用 shape 标签创建一个 xml 文件

I give one idea -> Create one xml file using shape tag

像这样

<?xml version="1.0" encoding="UTF-8"?>
  <shape xmlns:android="http://schemas.android.com/apk/res/android">
  <solid android:color="#FFFFFF"/>
  <stroke android:width="2dp" android:color="#515151"/>
  <corners android:radius="3dp" />
  <padding android:left="10dp" android:top="5dp"
    android:right="10dp" android:bottom="5dp" />
</shape>

在您的表格布局的android:background="@drawable/xmlFilename" 中设置此 xml 文件

set this xml file in android:background="@drawable/xmlFilename" of your table layout

它为您的桌面布局提供边框

it gives the border around your tablelayout

这篇关于如何在android中的tablelayout中为tablerow提供边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆