- Learning Xamarin Studio
- William Smith
- 189字
- 2021-09-03 10:01:24
Creating your first iOS application
Creating your first iOS application with Xamarin Studio is remarkably easy. For now, let's just build a simple project as a point of reference, as shown in the following steps. We'll dig into the details later.
- Within Xamarin Studio, navigate to File | New | Solution….
- Choose the C# | iOS | iPhone group.
- Choose the Single View Application project type.
- Name your project
HelloiPhone
and click OK. - Open the
HelloiPhoneViewController.cs
file. - We'll explore some code examples in detail later, but for now just replace the
ViewDidLoad()
method with the following block of code:UILabellabelHello; public override void ViewDidLoad () { base.ViewDidLoad (); var frame = new RectangleF(10, 10, 300, 30); labelHello = new UILabel(frame); labelHello.Text = "Hello, iPhone!"; View.Add (labelHello); }
- In the target dropdown, select iPhone Retina (4-inch) -> iOS 7.1.
- Click the Build and Run button.
That's it! You've created your first iOS application using Xamarin Studio! Yes it's merely a simple Hello World
variation, but this application proves that your environment is properly configured (assuming it ran, of course) and gives us an iOS context to work within.
推薦閱讀
- Mastering Visual Studio 2017
- MySQL 8從入門到精通(視頻教學版)
- Interactive Data Visualization with Python
- C# Programming Cookbook
- Visual FoxPro 程序設計
- Mastering Scientific Computing with R
- Spring Cloud、Nginx高并發核心編程
- Java:Data Science Made Easy
- INSTANT Passbook App Development for iOS How-to
- Learning OpenStack Networking(Neutron)(Second Edition)
- HTML5從入門到精通(第4版)
- Swift 4 Protocol-Oriented Programming(Third Edition)
- C# and .NET Core Test Driven Development
- 編程可以很簡單
- C編程技巧:117個問題解決方案示例