简体   繁体   中英

Android - Floating action button on top of Dialog Fragment

I've got a Floating Action Button and when I click on it I open a DialogFragment . When the dialog is opened, the button is below the dialog. My question is, how do I position the button after the onclick event on top of the DialogFragment ?

Well, I would do this trick : use Fragment and adjust it to look like dialog( you even can use dialog fragment theme ). Then use the same FAB on fragment layout ( Even better you can make transition view for fab. something like zoom out/in )... Here is the complete example uploaded on Github for you :-)

https://github.com/mabuthraa/Android-FabOverDialog

I will try later to improve that example by using Fragment theme and transition.

Good luck,'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM