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

Testing in an iOS simulator


For this exercise, you're going to create a new iOS solution and perform several basic functions using the simulator. Since you already have experience starting and running the simulator, we're going to focus on those tasks that simulate hardware state changes and user interactions with your View:

  1. Create a new solution.

  2. From the iPhone group under iOS, select the Empty Project template.

  3. Name your project iOSInMotion and click the OK button.

  4. Right-click on the iOSInMotion project and select Add | New File.

  5. From the iOS group, select iPhone View Controller and name your file MotionViewController.

  6. Replace all of the code in the class declaration with the following code:

    public MotionViewController () : base ("MotionViewController", null) { }
    public override bool CanBecomeFirstResponder 
    {
      get 
      {
        return true;
      }
    }
    UILabel label1;
    
    public override void ViewDidLoad ()
    {
      base.ViewDidLoad ();
      var frame = new RectangleF (10, 10, 300, 30);
      label1 = new UILabel ...