0

私の浮動アクションボタンは、押しても上げられません。FAB:pressedTranslationZが機能しません

レイアウトファイル:

<?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" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:background="@android:color/white" 
android:id="@+id/layout"> 

<android.support.v7.widget.RecyclerView 
    android:id="@+id/multiple_tally_recyclerview" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" /> 

<android.support.design.widget.FloatingActionButton 
    android:layout_width="56dp" 
    android:layout_height="56dp" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentEnd="true" 
    android:layout_marginBottom="16dp" 
    android:layout_marginRight="16dp" 
    app:backgroundTint="@android:color/holo_orange_dark" 
    app:elevation="6dp" 
    app:pressedTranslationZ="12dp" 
    app:srcCompat="@drawable/ic_add_black_24dp" /> 
    </RelativeLayout> 

app:pressedTranslationZが正常に動作していないようです。どうすれば修正できますか?

答えて

0

解決済み。私はちょうどOnClickListenerを設定せずに自分のFABをテストしていましたが、最後にOnClickListenerを設定してクリック数が増え始めました。

-1

以下のようなときpressed.Simply setOnClickListener pressedTranslationZは影が成長する原因として、あなたはFABにOnClickListener

を設定見逃している可能性があります:

fab.setOnClickListener(new View.OnClickListener() { 
      @Override 
public void onClick(View view) { 
      // implementation Code here 
    } 
関連する問題