0

私はxmlにこのコードを持っています:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<gradient
    android:angle="90"
    android:endColor="#222288"
    android:startColor="#9966cc" />

グラデーションの上に繰り返し画像を追加するにはどうすればよいですか? Android プロジェクトの背景レイヤー用です。このようなものですが、Androidの場合:

<style type="text/css">
body {
background-color: #666;
background-image:url(repeated_image.gif)
}
</style>
4

1 に答える 1

0

わかりました、形状とビットマップを含むレイヤーリストを使用して答えを得ました:

<?xml version="1.0" encoding="utf-8"?>

<item>
    <shape
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle" >
        <gradient
            android:angle="90"
            android:endColor="#222288"
            android:startColor="#9966cc" />
    </shape>
</item>
<item>
    <bitmap
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:src="@drawable/repeated_image"
        android:tileMode="repeat" />
</item>

于 2013-05-15T12:57:29.910 に答える