16

Gingerbreadバージョンのデバイスに割り当てられていないFABのxmlのbackgroundTint色を変更する際に問題が発生しました。私は本当に混乱していて、それがなぜ変わっているのか分からない。私はこの問題に完全に固執しており、数時間で解決策を呼び出すことができましたが、できませんでした。問題を解決するためのヒントや提案を教えてください。私はあなたの参照のために問題の私のコードとスクリーンショットを投稿しています。前もって感謝します。私のGradleのバージョンジンジャーブレッドとのFAB GingerbreadバージョンのデバイスでTint色が変更されていない

compile 'com.android.support:design:23.0.0' 

スクリーンショットで

include_fab.xml

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.FloatingActionButton 
    android:id="@+id/fab" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_gravity="bottom|right" 
    android:layout_marginBottom="20dp" 
    android:layout_marginRight="20dp" 
    app:backgroundTint="#FF0000" 
    app:borderWidth="0dp" 
    app:elevation="5dp" 
    app:fabSize="normal"/> 

設計サポートライブラリキットカット

注::GingerBreadデバイスの上に自分の要件が正確に出力されています。 GingerBreadだけで問題が発生します。

enter image description here

+0

私も同様の問題を抱えています。クラッシュする原因にもなります。あなたはGenymotionを使用していますか? – DariusL

+0

両方を使っていますが、私はこれをgenymotionで試しませんでした。 – Chandru

+0

私はgenymotionジンジャーブレッドのバージョンは持っていませんが、最新のバージョンのgenymotionでうまく動作しています – Chandru

答えて

2

これは、実際にライブラリのバグです

protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_main); 
     FloatingActionButton v = (FloatingActionButton) findViewById(R.id.fab); 
     ColorStateList csl = new ColorStateList(new int[][]{new int[0]}, new int[]{0xffff0000}); 
     v.setSupportBackgroundTintList(csl); 
    } 
+0

ありがとうございます。確認してお知らせします – Chandru

+1

@チャンドルあなたのために働くのですか?はいの場合、他の人が正しい答えを得るように回答を受け入れてください。質問があれば質問してください。 :) – RBK

1

動作する可能性があります。 hereが表示されているオープンなバグレポートがあります。

関連する問題