-
Book Overview & Buying
-
Table Of Contents
iOS Development with Xamarin Cookbook
By :
In this recipe, we will discuss how to display view controllers modally.
A modal view controller is any controller that is presented above other views or controllers. The concept is similar to displaying a Windows Form as a dialog, which takes control of the interface and does not allow access to other windows of the application unless it is dismissed. Create a new iPhone Empty Project in Xamarin Studio and name it ModalControllerApp.
Perform the following steps:
Add two view controllers to the project and name them MainController and ModalController.
Open the MainController.xib file in Interface Builder and add a button on its view with the title Present. Create and connect the appropriate outlet for the button.
In the MainController class, add the following code in the ViewDidLoad method:
this.buttonPresent.TouchUpInside += async (s, e) => {
ModalController modalController = new ModalController();
await this.PresentViewControllerAsync(modalController...
Change the font size
Change margin width
Change background colour