0
私はアンドロイドアプリで作業しています。背景と前景の両方のボタンが必要です。これはいくつかのアイコンです。ForegroundTintはボタン上のbackgroundTintを "上書き"しますか?
backgroundTintとforegroundTintを異なる色に設定したいのは、色のセレクタを書くときに必要になるからです。
問題は、私はforegroundTint設定した場合ということです!
- foregroundTintMode =乗算を - 背景の色合いはOKですが、フォアグラウンドアイコンは、それがカラー
- foregroundTintModeだ変更されていない=乗算 - フォアグラウンド色合いがOKですが、背景アイコンが色をforegroundTintに変更していますbackgroundTint
foregroundTintModeとbackgroundTintModeのすべての組み合わせを試しましたが、結果はありませんでした。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="euroicc.testfb.MainActivity"
android:background="@color/colorPrimary">
<Button
android:id="@+id/button"
android:layout_width="200dp"
android:layout_height="200dp"
android:background="@drawable/icon_background"
android:backgroundTint="@android:color/holo_blue_dark"
android:foreground="@drawable/icon_settings"
android:foregroundTint="@android:color/white"
tools:layout_editor_absoluteX="105dp"
tools:layout_editor_absoluteY="141dp" />
</RelativeLayout>
注:
はここに私のテストファイルである私は、最初は17 LVL APIでの作業が、このアプリは、できるだけ多くのデバイスをサポートするために、私は希望の21に変更されました。
おかげで、これはトリックはなかったです。 –