Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Display assigned layout

$
0
0

I have a problem to display some waves in a specific View layout that I assigned. How to assign the function "FilledPolygon" to a specific ID in the layout. "View for example".

Thank you


android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<View
    android:layout_width="500dp"
    android:layout_height="200dp"
    android:id="@+id/wv"
    android:layout_marginLeft="200dp"
    android:layout_marginTop="200dp" />


using Android.Graphics;

namespace WaveFormTest4
{
[Activity (Label = "WaveFormTest4", MainLauncher = true, Icon = "@drawable/icon")]
public class MainActivity : Activity
{
int count = 1;

    View wv;

    protected override void OnCreate (Bundle bundle)
    {
        base.OnCreate (bundle);

        // Set our view from the "main" layout resource
        SetContentView (Resource.Layout.Main);

        // Get our button from the layout resource,
        // and attach an event to it


        var wv = new FilledPolygon (this.BaseContext);  // this is what I'm having a problem with, it need to be display in the layout follow Id.wv
        SetContentView (wv);

    }

    public class FilledPolygon : View {

        private List<PointF> _points;

        public FilledPolygon (Context context) : base (context)
        {
            _points = new List<PointF>();
            SinWaveGenerator();
        }

Viewing all articles
Browse latest Browse all 58056

Trending Articles



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