Android FloatingActionButton突然只在ProGuard构建上透明

Big*_*dad 5 android android-appcompat floating-action-button

在我使用proguard构建版本后,将我的AppCompat库更新为25后,我的所有FloatingActionButton背景都是透明的.当我构建一个没有proguard的调试版本时,它就像应该的那样着色.

布局

 <android.support.design.widget.FloatingActionButton
    android:id="@+id/fab_upload"
    android:visibility="gone"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    app:layout_anchor="@id/content_frame"
    app:layout_anchorGravity="bottom|right|end"
    app:borderWidth="0dp"
    android:src="@drawable/app_fab_upload"
    android:layout_margin="@dimen/big_padding"
    android:clickable="true"
    app:backgroundTint="@color/fab_social"/>
Run Code Online (Sandbox Code Playgroud)

摇篮

compileSdkVersion = 25
buildToolsVersion = '25.0.0'
supportLibVersion = '25.0.0'

supportLibAppCompat = "com.android.support:appcompat-v7:$supportLibVersion"
supportLibCardView = "com.android.support:cardview-v7:$supportLibVersion"
supportLibRecyclerView = "com.android.support:recyclerview-v7:$supportLibVersion"
supportLibDesign = "com.android.support:design:$supportLibVersion"
supportLibPalette = "com.android.support:palette-v7:$supportLibVersion"
supportLibPercent = "com.android.support:percent:$supportLibVersion"
Run Code Online (Sandbox Code Playgroud)

我的proguard配置中没有任何对AppCompat的引用.

UPDATE

我只是尝试了另一个项目,它有同样的问题.这个问题似乎源于将Android Studio更新为2.3 Canary版本.

Nee*_*ava 0

尝试替换backgroundTint为此处的示例,该示例显示了背景色调和背景示例background之间的差异。

所以你的代码将是

<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_upload"
android:visibility="gone"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:layout_anchor="@id/content_frame"
app:layout_anchorGravity="bottom|right|end"
app:borderWidth="0dp"
android:src="@drawable/app_fab_upload"
android:layout_margin="@dimen/big_padding"
android:clickable="true"
android:background="@color/fab_social"/>
Run Code Online (Sandbox Code Playgroud)