用Delphi Xe2 開發(fā)第一個IOS程序
Delphi XE2 完整版: http://m.elephantinaurance.com/soft/33280.html
Delphi XE2 Lite (精簡版) http://m.elephantinaurance.com/soft/33387.html
原文
I have been excited for a while to build my own iOS application using Delphi XE2 and FireMonkey. First I installed RAD Studio XE2 on my Windows 7 machine and then went to the Apple Developer website to sign up for an account. Once my Apple Developer account was setup, I went ahead and installed Xcode and the iOS SDK on my Lion machine.
Also included with RAD Studio XE2 was ‘FireMonkey-iOS.dmg’ which includes two installer packages (Free Pascal compiler and FireMonkey iOS libraries) that you will need to run on your Mac. You can find the disk image in the Embarcadero RAD Studio program files subfolder, titled ‘FireMonkey-iOS’ on your Windows machine. Just copy it to your Mac and then run the installers.
After provisioning my iPhone following the steps explained on the Apple Developer site, I was excited to build my iPhone application. The project shown here didn’t take more than a couple of minutes to setup.
Using Delphi XE2, I started out with a new FireMonkey HD iOS application and added a TImage component for my FireMonkey logo and a Reflection effect which I adjusted the properties for to get desired look. Next, two Viewport 3D components were added to the form. One that contained a 3D Text component and a trackbar and one that contained a 3D Image component and a trackbar. I then dropped a couple of labels onto my form to display the angle of rotation. The form background color was changed to a nice gradient and the style changed to the FireMonkey iOS style.
This sample application with rotating 3D components, a cool reflection effect and a nice gradient was created in about 5 minutes with only three lines of code.
The 3D text component is linked to the trackbar, rotating around the y axis:
Text3D1.RotationAngle.y := TrackBar1.Value
The 3D image component is linked to the trackbar, rotating around the x axis and displaying the angle of rotation in Label2.
Image3D1.RotationAngle.x := TrackBar2.Value;//-19 to adjust for initial angle of rotation Label2.Text := IntToStr(Round(TrackBar2.Value - (-19)));
After I finished my project, I hit Run to view it on my Win 7 development machine, after making sure that my files were saved to a folder that I could easily access on my Mac.
By going to ‘Tools ->Export to Xcode’, you can export your project to Xcode. (You have to configure your Windows development machine to export Xcode project files which takes a couple of easy steps to complete. Configuration info can be found here: http://docwiki.embarcadero.com/RADStudio/en/FireMonkey_Platform_Prerequisites )
I then switched to my Mac and browsed to my shared projects folder and the Xcode subfolder. I also created a custom app icon quickly in Photoshop and swapped it out for the Delphi one that was previously found in my Xcode folder. I then opened my Xcode project in Xcode and hit run.
First I viewed my app in the simulator and then ran it on my iPhone. The included pictures and short video show you my running iOS application.
用 Google 翻譯的文章
我一直興奮了一會兒,來構(gòu)建自己的IOS應用程序使用Delphi XE2和FireMonkey。首先,我在我的Windows 7機器上安裝RAD Studio的XE2,然后去蘋果開發(fā)人員網(wǎng)站注冊一個帳戶。一旦我的蘋果開發(fā)人員帳戶的設(shè)置,我繼續(xù)我的獅子機上安裝的Xcode和IOS SDK。
與RAD Studio的XE2還包括“FireMonkey - iOS.dmg其中包含兩個安裝程序包(Free Pascal編譯器和FireMonkey iOS的圖書館),您將需要在Mac上運行。你可以找到在Embarcadero RAD Studio程序文件的子文件夾的磁盤映像,題為“FireMonkey - IOS”您的Windows機器上。只要將它復制到你的Mac,然后運行安裝程序。
配置我的iPhone下列步驟蘋果開發(fā)者網(wǎng)站上的解釋后,我很興奮,建立我的iPhone應用程序。這里顯示的項目沒有采取更超過兩分鐘設(shè)置。
使用Delphi XE2中,我開始了一個新FireMonkey高清IOS的應用程序,并添加了我FireMonkey標志的TImage組件和反射效果,我調(diào)整了屬性以獲得所需的外觀。接下來,兩個視口的3D組件被添加到窗體。包含一個3D文字組件的TrackBar包含一個三維圖像組件和一個的TrackBar。然后我放棄我的窗體上的標簽,以顯示旋轉(zhuǎn)的角度。窗體的背景色更改為一個很好的梯度和改變的FireMonkey IOS風格樣式。
這與旋轉(zhuǎn)的3D組件,冷靜的反射效果和一個不錯的梯度的示例應用程序是在5分鐘左右,只有三行代碼。
3D文本組件被鏈接到的TrackBar,繞Y軸旋轉(zhuǎn):
Text3D1.RotationAngle.y:= TrackBar1.Value的三維圖像組件是聯(lián)系在一起的TrackBar,繞X軸旋轉(zhuǎn),并顯示在Label2的旋轉(zhuǎn)的角度。
Image3D1.RotationAngle.x:= TrackBar2.Value; / / -19,調(diào)整旋轉(zhuǎn)Label2.Text初步角度:= IntToStr(回合(TrackBar2.Value - (-19)));
當我完成我的項目,我打勝7開發(fā)機器上運行,以查看后確保我的文件被保存到一個文件夾,我可以很容易地訪問我的Mac上。
通過將“工具 - >出口到Xcode”,您可以導出你的項目到Xcode。 (您必須配置您的Windows開發(fā)機器出口XCode項目文件,這需要幾個簡單的步驟來完成配置信息可以在這里找到:http://docwiki.embarcadero.com/RADStudio/en/FireMonkey_Platform_Prerequisites)
然后我切換到我的Mac上瀏覽到我的共享項目文件夾和Xcode的子文件夾。我也創(chuàng)建了一個定制的應用程序圖標在Photoshop中快速交換德爾福以前在我的Xcode文件夾中發(fā)現(xiàn)。然后,我在Xcode中打開我的Xcode項目和命中運行。
首先,我查看我的應用程序在模擬器上,然后跑在我的iPhone。包含的圖片和錄像短片,展示你我的運行iOS應用程序。