- 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.
推薦閱讀
- Java高并發(fā)核心編程(卷2):多線程、鎖、JMM、JUC、高并發(fā)設計模式
- Windows系統(tǒng)管理與服務配置
- Java程序設計
- 軟件測試實用教程
- Julia for Data Science
- Zabbix Performance Tuning
- 多媒體技術及應用
- 編程的原則:改善代碼質(zhì)量的101個方法
- 讓Python遇上Office:從編程入門到自動化辦公實踐
- Enterprise Application Architecture with .NET Core
- Swift從入門到精通 (移動開發(fā)叢書)
- 多接入邊緣計算實戰(zhàn)
- 交互設計語言:與萬物對話的藝術(全兩冊)
- App Inventor開發(fā)實戰(zhàn)
- Cloud Native Python