Xamarin.Forms StackLayout 教學課程

在嘗試此教學課程之前,您應該已成功完成:

在本教學課程中,您會了解如何:

  • 在 XAML 中建立 Xamarin.FormsStackLayout
  • 指定 StackLayout 的方向。
  • 控制 StackLayout 內的子檢視對齊和延展。

您將會使用 Visual Studio 2019 或 Visual Studio for Mac 來建立能示範如何在 StackLayout 內對齊控制項的簡單應用程式。 下列螢幕擷取畫面顯示的是最終的應用程式:

Screenshot of child views in a StackLayout, with alignment and expansion options set, on iOS and Android

您也會使用 XAML 熱重新載入 Xamarin.Forms 來查看 UI 變更,而不需重建應用程式。