Utiliser un SVG comme arrière-plan pouvant être dessiné dans Android

Je suis en train d'utiliser une image SVG (créé à l'aide d'Inkscape et enregistré au format SVG) comme arrière-plan pour mon application. Je suis en train de le faire à l'aide de la svg-android de la bibliothèque. J'ai un fichier appelé background.svg dans res/raw. Mon code ressemble à ceci:

SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.background);
Drawable pictureDrawable = svg.createPictureDrawable();
Bitmap bitmap = Bitmap.createBitmap(pictureDrawable.getIntrinsicWidth(), pictureDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
BitmapDrawable bitmapDrawable = new BitmapDrawable(bitmap);

LinearLayout backgroundLayout = (LinearLayout) findViewById(R.id.background);
bitmapDrawable.setTileModeX(Shader.TileMode.REPEAT);
backgroundLayout.setBackgroundDrawable(bitmapDrawable);

Toutefois, lorsque mon application se lance, rien ne montre jusqu'à ce que le fond (autre que la couleur de fond de la mise en page). Ma mise en page fichier xml est comme suit:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#aacceeff"
    >

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/background"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    >
 </LinearLayout>

</LinearLayout>

Mise à JOUR

Il semble qu'il y ait un problème avec mon fichier SVG. Il peut être dû au fait que toutes les fonctionnalités ne sont pas pris en charge.

source d'informationauteur Vivin Paliath