Floating Action Button For Xamarin.Forms

vasconvascon RUMember

I'm trying to add FAB to my Xamarin.Forms project using FAB.Forms 2.1.1. But I can't even repeat the example shown on their GitHub page. No components appear on the screen.
Please tell me what may be my mistake?

using Xamarin.Forms;
using FAB.Forms;
namespace ExtraService
{
public class test1 : ContentPage
{
public test1()
{
var layout = new RelativeLayout();
var normalFab = new FAB.Forms.FloatingActionButton();
normalFab.Source = "devices.png";
normalFab.Size = FabSize.Normal;

        layout.Children.Add(
            normalFab,
            xConstraint: Constraint.RelativeToParent((parent) => { return (parent.Width - normalFab.Width) - 16; }),
            yConstraint: Constraint.RelativeToParent((parent) => { return (parent.Height - normalFab.Height) - 16; })
        );
        normalFab.SizeChanged += (sender, args) => { layout.ForceLayout(); };
        Content = layout;
    }
}

}

Sign In or Register to comment.