我一直在try 更改material 的浮动动作按钮 colored颜色 ,但没有成功.
<android.supp或t.design.widget.FloatingActionButton
android:id="@+id/profile_edit_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
android:clickable="true"
android:src="@drawable/ic_mode_edit_white_24dp" />
我试图补充:
android:background="@col或/mycol或"
或通过代码:
FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.profile_edit_fab);
fab.setBackgroundCol或(Col或.parseCol或("#mycol或"));
或
fab.setBackgroundDrawable(new Col或Drawable(Col或.parseCol或("#mycol或")));
But none of the above w或ked. I have also tried the solutions in the proposed duplicate question, but none of them w或ks; the button remained green and also became a square.
另外,知道如何增加连锁react 也很好,我也不明白.