Forum Xamarin.Mac

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Example of adding action objects at run time

DanBolDanBol USMember ✭✭

I am trying to find some examples of adding action objects (ex buttons, dropdown, text fields, etc) as run time to a view. I swear I saw an example on the Xamarin.Mac source code list but now I can't find it.

Answers

  • AhmetErcekAhmetErcek Member ✭✭

    you can add it to layout with Children.Add(component) method.

    Label label1 = new Label { Text = "ExampleLabel", BackgroundColor = Color.Gray};
    targetLayout.Children.Add(label1 );
    
Sign In or Register to comment.