我在其父布局中有一个子布局。如果我为父级设置任何背景颜色,它也会为其子级设置相同的颜色。但我不想为孩子设置相同的颜色。(我想要默认的android黑色作为孩子的背景)。请帮我。
编辑:
我需要捕获子布局并稍后创建位图,所以我不应该为子设置任何背景颜色(但它的父级应该有一些颜色)。它应该只设置为默认的 android black。
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#FFA500" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_margin="15dp"
android:layout_weight="1"
android:gravity="center" >
</RelativeLayout>
</LinearLayout>
父线性布局有一些 BG 颜色。我没有为子相对布局设置任何 BG 颜色,但它采用了父的 BG 颜色。那么现在,我该如何为孩子设置 android 默认 BG 颜色?