Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Create a ViewRenderer for Android.Support.Design.Widget FloatingActionButton

$
0
0

Hello,

I'm trying to create a view renderer for FloatingActionButton which in the : https://components.xamarin.com/gettingstarted/xamandroidsupportdesign librairy.

I try to display it, first, simply without any binding properties from the PCL.

I don't know how to set some basic properties like android:layout_gravity directly from code.
Or eventualy set axml code from Resource.Layout and other properties needed to display the Floating Button.

That's the code i'm trying to complete :

public class FloatingActionButtonViewRenderer : ViewRenderer<FloatingActionButtonView, FrameLayout>
    {

        public FloatingActionButtonViewRenderer()
        {
            FloatingActionButton floatingActionButton = new FloatingActionButton(Xamarin.Forms.Forms.Context);
            floatingActionButton.SetBackgroundColor(Android.Graphics.Color.Black);
            floatingActionButton.Enabled = true;
            //don't know what to add here to set properties like :
            //android:layout_with / android:layout_height / android:layout_gravity etc.
// and other element needed to display
        }
}

Thanks to everybody trying to answering to this thread :smile:

Math


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>