Android的桌圆边框 [英] Android table with round border
问题描述
我怎样才能让一个表圆边框,类似下面的照片,在Android中?
How can I make a table with a round border, similar to the photo below, in Android?
推荐答案
我觉得Androidbase链接到错误的问题......他问过类似的问题,最近,和这里的<一个href="http://stackoverflow.com/questions/2379578/how-to-show-group-tableview-android/2381894#2381894">answer我给了他:
I think Androidbase linked to the wrong question... he asked a similar question recently, and here's the answer I gave him:
您可以把一个彩色的背景与圆角到表使用形状的背景。在XML文件中创建一个这样的形状,放在你的可绘制文件夹。
You can put a coloured background with rounded corners into a table by using a Shape background. Create such a shape in an XML file, put in your drawables folder.
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#99FFFFFF"/>
<corners android:radius="30px"/>
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>
例如上述创建的半透明白色背景30像素圆角。您可以设置此表中使用
For example the above creates a semi-transparent white background with 30px rounded corners. You set this to the table by using
android:background="@drawable/my_shape_file"
在这里你定义你的表布局XML文件中的
in the XML file where you defined your table layout.
这篇关于Android的桌圆边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!