![](/img/trans.png)
[英]Material Design : how to set transparency for Android Floating Action Button
[英]How to create a submenu for Floating Action Button in Android Material Design?
我想在單擊我的浮動操作按鈕后創建一個子菜單,如下所示:
我已經知道這個圖書館:
https://github.com/futuresimple/android-floating-action-button
但我想用android支持設計的原生FAB來創建這個:
compile 'com.android.support:design:23.+'
和
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:src="@drawable/ic_add" />
直接是不可能的。 android.support.design.widget.FloatingActionButton
是ImageView
的子類,它不能承載子類。 您必須實現自己的 ViewGroup(垂直LinearLayout
應該就足夠了)並將FloatingActionButton
放入其中
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.