2つの画像を含むアイテムを含むListViewを取得したテストアプリがあります。
ご覧のとおり、API 17デバイスでは再生ボタン(SVG画像)が表示されませんが、API10デバイスでは表示されます。どうすれば修正できますか?
私のレイアウトファイル:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/background"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/forceground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
</RelativeLayout>
画像を設定する基本的なコードは次のとおりです。
View preview = inflater.inflate(R.layout.list_video_preview, parent, false);
ImageView background = (ImageView)preview.findViewById(R.id.background);
ImageView forceground = (ImageView)preview.findViewById(R.id.forceground);
PictureDrawable play = SVGParser.getSVGFromResource(parent.getResources(), R.raw.play_blue).createPictureDrawable();
forceground.setImageDrawable(play);
SVGペーサーはsvg-androidからのものです。