背景画像として、またはプログラムで(Android 4.0で)背景として(放射状)グラデーションを追加しようとしましたが、どれも機能しません。エミュレータでしかテストできませんが、4.0 デバイスでも同じだと思います。
これらの解決策は機能しません:
- raw フォルダに配置します。( Android リソース / 画像 / png 最適化を無効にする)
- ディザリングとアンチエイリアシングを true にしてプロキシ xml を作成し、png の不透明度を 99% に保存します。( android:dither="true" はディザリングしません。何が問題なのですか? )
- onAttachedToWindow のオーバーライド ( Android: 背景が帯状に見えるように線形グラデーションを使用)
- hdpi フォルダーに移動 ( Gingerbread のグラデーション)
- プログラムでグラデーションを作成する ( http://crazygui.wordpress.com/2010/09/05/high-quality-radial-gradient-in-android/ )
私はさらにいくつかのことを試したと思いますが、誰かが背景として作業グラデーションを作成する方法を知っているのでしょうか?
私の現在のコードは次のようになります。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SplashScreen">
<ImageView
android:id="@+id/imageViewLogo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/desc_string"
android:scaleType="centerCrop"
android:src="@drawable/background_image" />
</RelativeLayout>
および background_image.xml
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/background_image"
android:antialias="true"
android:dither="true"
android:src="@drawable/bg_portrait" />