Android中的阴影透明背景

时间:2012-01-12 05:46:44

标签: android android-layout android-widget

我想要透明的tablelayout背景,浅灰色。

2 个答案:

答案 0 :(得分:1)

在XML布局中添加:

android:background="#BCB8B8"

答案 1 :(得分:1)

在drawable文件夹中创建XML:

<强> gray_shade.xml:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
  <gradient
      android:startColor="#00000000"
      android:centerColor="#30000000"
      android:endColor="#40000000"
      android:angle="270" />
</shape>

现在,在XML中使用它作为布局的背景:

...
android:background="@drawable/gray_shade"
...
相关问题