pritam
pritam

Reputation: 31

Displaying a subview on button click

I am developing an ios app in xamarin .How to display a subview(i have used xcode IB for creating a subview) when a button is clicked.Then when i click the same button, again subview must be displayed.If button is pressed 3 times, 3 subviews must be displayed.

Upvotes: 2

Views: 1625

Answers (1)

olexa.le
olexa.le

Reputation: 1807

In a very common way it will be something like that:

yourButton.TouchUpInside += (object sender, EventArgs e) => {
    var newView = new UIView();
    // do some stuff with your view here
    this.Add (newView);
};

Upvotes: 1

Related Questions