That's elegantly simple. Just a button laying on top of the view that keeps positioning to the lower corner. How well does this handle being on top of a ScrollView? if you scroll the view does your faux FAB stay in place without gittering?
I had been considering an rg.plugins.popup that just had the FAB on it with Dismiss if clicked off set to false. Then it would be a reusable self contained thing I could define outside of the view and place on each page as needed. yeah, I'll get around to that in my spare time.
Seems to work fine.....even in UWP. Certainly it plays fine with RadList. I'll knock together a quick sample app with the vanilla listview just to double check.
here's the FAB button sample as promised. Probably needs more work but it's certainly less painful than surfacing the Android FAB button and it's cross platform.
Hi @NMackay , Can you suggest how to call the method using the custom control you have given for FAT. My requirement is after clicking on the FAT button, I should display a View with multiple data to capture.
The image button has a command property you can just bind against a command in your viewmodel to do the navigation. If you prefer a code-behind approach there's an ItemTapped event you can hook in to.
If you check out the markup, it's basically on a page by page basis. The FAB in Android will not overlay every page you push on to the stack either as far as I'm aware. Just add it on a page by page basis.
@NMackay said:
If you check out the markup, it's basically on a page by page basis. The FAB in Android will not overlay every page you push on to the stack either as far as I'm aware. Just add it on a page by page basis.
@NMackay is there a way we can hide FAB on home page and show it on rest of the pages(All pages), once we navigate. I am using Xamarin Forms.
No, you'd have to add the FAB button to each page you want to have it, most apps I've seen like WhatsApp only have the fab button the top level page, as it doesn't exist in iOS/UWP there is no hard and fast UX rules on it, it's part of the material design in Android, this approach just saves you a lot of grief in a cross platform app.
Your solution is wonderful. I have so many questions about your code though. Lets start with one question: I don't see a ScrollView anywhere in your code. How do you get the screen to scroll without one?
(I'm starting with one question because this post is so old you might not notice it)
Your solution is wonderful. I have so many questions about your code though. Lets start with one question: I don't see a ScrollView anywhere in your code. How do you get the screen to scroll without one?
(I'm starting with one question because this post is so old you might not notice it)
Hi,
Sorry for the delay in replying, I'm on annual leave, I just happened to see this post on my handset.
From memory, the sample uses a listview which has a built in scrollview/scrolling.
Answers
https://blog.xamarin.com/embedding-native-controls-into-xamarin-forms/
https://github.com/keannan5390/Xamarin.Plugin.FAB
I cheated and used absolutelayout and an image with a tap gesture, works on Droid, UWP and iOS.
Seems to work quite well.
I can knock up a sample app if anyone's interested.
That's elegantly simple. Just a button laying on top of the view that keeps positioning to the lower corner. How well does this handle being on top of a
ScrollView
? if you scroll the view does your faux FAB stay in place without gittering?I had been considering an rg.plugins.popup that just had the FAB on it with
Dismiss if clicked off
set to false. Then it would be a reusable self contained thing I could define outside of the view and place on each page as needed. yeah, I'll get around to that in my spare time.@ClintStLaurent
Seems to work fine.....even in UWP. Certainly it plays fine with RadList. I'll knock together a quick sample app with the vanilla listview just to double check.
@ClintStLaurent @KavyaS
Hi,
here's the FAB button sample as promised. Probably needs more work but it's certainly less painful than surfacing the Android FAB button and it's cross platform.
You're a scholar and a gentleman @NMackay
Thanks a lot, @NMackay. Your solution has helped me a lot.
Hi @NMackay , Can you suggest how to call the method using the custom control you have given for FAT. My requirement is after clicking on the FAT button, I should display a View with multiple data to capture.
@ArunH
The image button has a command property you can just bind against a command in your viewmodel to do the navigation. If you prefer a code-behind approach there's an ItemTapped event you can hook in to.
@NMackay
How does it fare with the master detail page or any subpage that might need to be rendered on top of the FAB?
If you check out the markup, it's basically on a page by page basis. The FAB in Android will not overlay every page you push on to the stack either as far as I'm aware. Just add it on a page by page basis.
@NMackay
This one worked beautifully with the setup I had. No issues! Thanks for the sample.
@RohanSatpute
Awesome, glad you found it useful
@NMackay Man youuu areee awesomeeee! Thanks for the sample
@NMackay is there a way we can hide FAB on home page and show it on rest of the pages(All pages), once we navigate. I am using Xamarin Forms.
@GSalunkhe
No, you'd have to add the FAB button to each page you want to have it, most apps I've seen like WhatsApp only have the fab button the top level page, as it doesn't exist in iOS/UWP there is no hard and fast UX rules on it, it's part of the material design in Android, this approach just saves you a lot of grief in a cross platform app.
@NMackay great solution.
@NMackay,
Your solution is wonderful. I have so many questions about your code though. Lets start with one question: I don't see a ScrollView anywhere in your code. How do you get the screen to scroll without one?
(I'm starting with one question because this post is so old you might not notice it)
Hi,
Sorry for the delay in replying, I'm on annual leave, I just happened to see this post on my handset.
From memory, the sample uses a listview which has a built in scrollview/scrolling.
@NMackay
Based on your solution i was able to make a custom expandable float FAB menu.
Thanks!
Just Awesome !!!
Nearly 2 years later and this is still the most efficient solution. Thanks @NMackay !
The coolness of Forms,
Thanks
jamesmontemagno has done it too, for Android and Xamarin Forms too
https://github.com/jamesmontemagno/FloatingActionButton-for-Xamarin.Android
@NMackay
Your solution looks good, Also could you share the Image button code for below control.
The image button is in the zip file in my original post, I also posted it here recently.
https://forums.xamarin.com/discussion/comment/365506#Comment_365506
U can use this
https://github.com/cemozguraA/Xamarin.RisePlugin.Floatingactionbutton
I love this!!
Very nice solution @NMackay!
Would be nice to extend this and make it invisible when scrolled up and visible again when scrolled down.