私はこの(簡略化された)レイアウトを持っています.-
<RelativeLayout xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/background_pattern" >
    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="@dimen/dimen5"
        android:layout_marginTop="@dimen/dimen15"
        android:background="@drawable/background_grey" >
        <ImageView
            android:id="@+id/logo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:contentDescription="@string/app_logo"
            android:src="@drawable/app_logo" />
    </RelativeLayout>
</RelativeLayout>
Eclipse レイアウト エディターで適切にレンダリングされるもの: my app_logoimage over background_grey、これは over background_patternimage です。しかし、デバイスで実行すると、期待どおりにbackground_greyレンダリングされますbackground_patternが、その子にもレンダリングされapp_logoます。
バックグラウンド属性で複数のレイアウトをネストするとき、何か間違ったことをしていますか、これは何らかのバグですか?
回避策として、の背景属性を置き換えることができると思いますがImageViews、これが機能する可能性があり、明らかなものが欠けていると確信しています。
最新のADT
を使用して動作し、Nexus 4 にデプロイする 4.2.2
background_greyは 9 パッチのイメージです