Forum Xamarin Xamarin.iOS

Parameters to Instantiate a TextView control created in a Storyboard

G3MisaG3Misa USMember


On the Xcode storyboard i dragged a TextView control and named its custom class TextViewDescription. After syncing with Xamarin i can see TextViewDescription.cs. On the ViewController i'm trying to set the Text of TextViewDescription but i'm getting an "Does not contain a constructor that takes 0 arguments". I have no idea what argument to pass it. Can anyone please help?


            var tvDesc = new TextViewDescription();
            tvDesc.Text = products[0].ProductDesc;

            View.Add (tvDesc);


  • G3MisaG3Misa USMember

    it's asking for a System.IntPtr and I have no idea what that is. Help?

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭

    Did you intend to create a new class, or do you just want to set its properties in C#?

    If the latter, then you just need to create an Outlet for it, and leave its class as UITextView.

  • G3MisaG3Misa USMember


    Yes creating an Outlet solved it!


Sign In or Register to comment.