- 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.
推薦閱讀
- Node.js Design Patterns
- 深入淺出Electron:原理、工程與實(shí)踐
- Three.js開發(fā)指南:基于WebGL和HTML5在網(wǎng)頁上渲染3D圖形和動(dòng)畫(原書第3版)
- C# 從入門到項(xiàng)目實(shí)踐(超值版)
- Scratch真好玩:教小孩學(xué)編程
- Troubleshooting PostgreSQL
- Mastering macOS Programming
- HTML5+CSS3網(wǎng)站設(shè)計(jì)基礎(chǔ)教程
- Android開發(fā):從0到1 (清華開發(fā)者書庫)
- ANSYS Fluent 二次開發(fā)指南
- SQL Server數(shù)據(jù)庫管理與開發(fā)兵書
- C/C++數(shù)據(jù)結(jié)構(gòu)與算法速學(xué)速用大辭典
- Clojure Polymorphism
- Photoshop智能手機(jī)APP界面設(shè)計(jì)
- Python數(shù)據(jù)科學(xué)實(shí)踐指南