使用 Xamarin 建立使用者介面Building User Interfaces with Xamarin.iOS

iOS 設計工具iOS Designer

我們已建立適用于 iOS 分鏡腳本格式的設計工具,其已完全整合到 Visual Studio for Mac 中。We have built a designer for the iOS storyboard format which is fully integrated into Visual Studio for Mac. IOS 設計工具維持與分鏡腳本格式的完全相容性,因此可以在 Xcode 或 Visual Studio for Mac 中編輯檔案。The iOS designer maintains full compatibility with the storyboard format, so that files can be edited in either Xcode or Visual Studio for Mac. 此外,編輯器也支援先進的功能,例如編輯器中設計階段所呈現的自訂控制項。Additionally, the editor supports advanced features, such as custom controls that render at design-time in the editor.

Storyboard 簡介Introduction to Storyboards

分鏡腳本是外觀和應用程式流程的視覺標記法。A Storyboard is a visual representation of the appearance and flow of your application. Xamarin 引進了一個設計工具,可讓 Xamarin iOS 應用程式利用分鏡腳本,讓您能夠以視覺化方式設計應用程式畫面,並使用C#更多控制來存取視圖、控制器和 segue。Xamarin has introduced a Designer to allow Xamarin.iOS applications to take advantage of storyboards, so you can design your application screen visually and access the views, controllers and segues with C# for more control. 您也可以參考本指南,以取得 Xamarin Designer for iOS 的說明和逐步解說You can also refer to this guide for an explanation and walkthrough of the Xamarin Designer for iOS

iOS 中的使用者介面User Interface in iOS

涵蓋在 Xamarin iOS 應用程式中使用 iOS 使用者介面,包括:外觀 API、建立使用者介面物件、版面配置選項、提供 Haptic 的意見反應,以及使用 UI 執行緒。Covers working with the iOS User Interface in a Xamarin.iOS app including: the Appearance API, Creating User Interface Objects, Layout Options, Providing Haptic Feedback and Working with the UI Thread.

使用者介面控制項User Interface Controls

Xamarin 會公開 Apple 提供的所有原生使用者介面物件。Xamarin.iOS exposes all the native user interface objects provided by Apple. 您可以使用 iOS 設計工具、Xcode 的 Interface Builder 或程式設計方式,輕鬆地將它們新增至 Xamarin iOS 應用程式。They are easily added to Xamarin.iOS applications using the iOS Designer, Xcode's Interface Builder or programmatically. 無論您選擇哪一種方法,Xamarin 都會公開中C#的所有使用者介面物件屬性和方法。Regardless of which method you choose, Xamarin.iOS exposes all the user interface object properties and methods in C#.