Book Image

iOS Development with Xamarin Cookbook

By : Dimitrios Tavlikos (USD)
Book Image

iOS Development with Xamarin Cookbook

By: Dimitrios Tavlikos (USD)

Overview of this book

Table of Contents (22 chapters)
iOS Development with Xamarin Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding and customizing views


In this recipe, we will discuss how to add and customize UIView with Xcode's Interface Builder.

Getting ready

Adding views with Interface Builder is a simple task. Let's start by creating a new iPhone Single View Application project in Xamarin Studio. Name the project FirstViewApp and open the FirstViewAppViewController.xib file with Interface Builder.

How to do it...

Perform the following steps:

  1. To add a view to the project, drag-and-drop a UIView object from the Library pad onto the main view. Make sure that it fits the entire window area. To make UIView accessible, create an outlet for it and name it subView.

    Note

    The concept of outlets and how to use them is discussed in detail in Chapter 1, Development Tools.

  2. Select the view that we have just added and go to the Inspector pad. Select the Attributes tab, and select Dark Gray Color in the Background drop-down list. Now, select the Size tab and reduce the view's height by 60 points. Save the document.

  3. Compile and run...