Siehe diesen Link Floating Action Button-Toolbar https://github.com/AlexKolpa/fab-toolbar
Sie es brauchen Abhängigkeit im Projekt hinzuzufügen.
compile 'com.github.alexkolpa:floating-action-button-toolbar:0.5.1'
In der XML-Datei,
<com.github.alexkolpa.fabtoolbar.FabToolbar
android:id="@+id/fab_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
tb:tb_anim_duration="500"
tb:tb_button_gravity="end"
tb:tb_container_gravity="center"
>
<ImageView
android:id="@+id/attach"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_attachment_white_48dp"
android:layout_marginLeft="@dimen/icon_margin"
android:layout_marginRight="@dimen/icon_margin"
/>
<!-- More buttons can be added here -->
Um die Symbolleiste ein- oder auszublenden, rufen Sie einfach hide()
und show()
.
FabToolbar fabToolbar = ((FabToolbar) findViewById(R.id.fab_toolbar));
findViewById(R.id.attach).setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
fabToolbar.hide();
}
});
Das FAB du sprichst über uns eine Animation mit Morphing-Effekten. 'Swiggy' – W4R10CK
Wie kann ich das tun? Wie man diese Art von Layout auf Klick von FAB einstellt? –
lesen Sie mehr hier https://github.com/hujiaweibujidao/FabDialogMorph – W4R10CK