使用者介面User Interface

下列各節說明各種用來在 Xamarin Android 應用程式中撰寫使用者介面的工具和建立區塊。The following sections explain the various tools and building blocks that are used to compose user interfaces in Xamarin.Android apps.

Android DesignerAndroid Designer

本節說明如何使用 Android Designer,以視覺化方式配置控制項並編輯屬性。This section explains how to use the Android Designer to lay out controls visually and edit properties. 它也會說明如何使用設計工具來處理各種設定(例如主題、語言和裝置設定)的使用者介面和資源,以及如何針對橫向和縱向等替代視圖進行設計。It also explains how to use the Designer to work with user interfaces and resources across various configurations, such as themes, languages, and device configurations, as well as how to design for alternative views like landscape and portrait.

材料佈景主題Material Theme

材質主題是使用者介面樣式,可決定 Android 中視圖和活動的外觀與風格。Material Theme is the user interface style that determines the look and feel of views and activities in Android. 材質主題內建于 Android 中,因此系統 UI 以及應用程式會使用它。Material Theme is built into Android, so it is used by the system UI as well as by applications. 本指南介紹材質設計原則,並說明如何使用內建材質主題或自訂主題來主題應用程式。This guide introduces Material Design principles and explains how to theme an app using either built-in Material Themes or a custom theme.

使用者設定檔User Profile

本指南說明如何存取裝置擁有者的個人設定檔,包括連絡人資料,例如裝置擁有者的名稱和電話號碼。This guide explains how to access the personal profile for the owner of a device, including contact data such as the device owner's name and phone number.

啟動顯示畫面Splash Screen

Android 應用程式需要一些時間才能啟動,特別是當應用程式第一次在裝置上啟動時。An Android app takes some time to start up, especially when the app is first launched on a device. 啟動顯示畫面可能會顯示使用者的開始進度。A splash screen may display start up progress to the user. 本指南說明如何為您的應用程式建立啟動顯示畫面。This guide explains how to create a splash screen for your app.

版面配置Layouts

版面配置是用來定義使用者介面的視覺化結構。Layouts are used to define the visual structure for a user interface. ListViewRecyclerView 的配置是 Android 應用程式的最基本組建區塊。Layouts such as ListView and RecyclerView are the most fundamental building blocks of Android applications. 一般而言,版面配置會使用 Adapter,將配置中的橋樑當做用來填入版面配置中資料項目的基礎資料。Typically, a layout will use an Adapter to act as a bridge from the layout to the underlying data that is used to populate data items in the layout. 本節說明如何使用版面配置,例如 LinearLayoutRelativeLayoutTableLayoutRecyclerViewGridViewThis section explains how to use layouts such as LinearLayout, RelativeLayout, TableLayout, RecyclerView, and GridView.

控制項Controls

Android 控制項(也稱為 widget)是您用來建立使用者介面的 UI 元素。Android controls (also called widgets) are the UI elements that you use to build a user interface. 本節說明如何使用按鈕、工具列、日期/時間選擇器、行事曆、spinners、交換器、快顯功能表、view 呼機和 web views 等控制項。This section explains how to use controls such as buttons, toolbars, date/time pickers, calendars, spinners, switches, pop-up menus, view pagers, and web views.