Book Image

Learning Xamarin studio

By : William Smith
Book Image

Learning Xamarin studio

By: William Smith

Overview of this book

Table of Contents (16 chapters)
Learning Xamarin Studio
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding a ViewController to our project


Let's manually create a ViewController that consists of a label, text field, and button:

  1. In Xamarin Studio, create a new solution by going to iOS | Empty Application, and name it UpdateLabelApplication.

  2. Right-click on the UpdateLabelApplication project and select Add File….

  3. Select a file by going to iOS | iPhone View Controller.

  4. Name the file UpdateLabelViewController and click on the New button.

  5. If Xcode does not open Interface Builder automatically, open the file from the Solution Explorer pad.

  6. Switch to the assistant view, and open the UpdateLabelViewController.h file in the right pane using the jump bar.

  7. Using the Object Library in the Utility Area, drag-and-drop a Text Field, Button, and Label control onto the view in the left pane of Interface Builder. Your view should look something like the following screenshot:

  8. Holding down the Ctrl key, select the text field and drag a wire across to the .h file, releasing just below the @interface label.

  9. Create an...