-
Book Overview & Buying
-
Table Of Contents
iOS Development with Xamarin Cookbook
By :
In this recipe, we will learn how to use the UIViewController class to manage views.
Create a new iPhone Empty Project in Xamarin Studio and name it ViewControllerApp.
Perform the following steps to load a view with a view controller:
Add a new file to the project.
Right-click on the project in the Solution pad and go to Add | New File….
In the dialog that will appear, select iPhone View Controller from the iOS section. Name it MainViewController and click on the New button. Xamarin Studio will create a new XIB file and will automatically open the MainViewController.cs source file. This file contains a class that overrides the UIViewController class, and we can implement any code related to our view controller in it.
Open the MainViewController.xib file in Interface Builder.
Add UILabel on the view.
Create and connect an outlet for it inside the MainViewController class and name it myLabel.
Enter the text View in controller! in the...
Change the font size
Change margin width
Change background colour