比如如何给 LinearLayout 指定渐变背景色呢?
第一步、在 res/drawable/ 下新建一个 background.xml,内容如下:
第二步、在 LinearLayout 中指定 background,如下: