Xamarin.Forms 按钮教程

开始演练本教程的前提条件为已成功完成以下教程:Before attempting this tutorial, you should have successfully completed the:

在本教程中,你将了解:In this tutorial, you learn how to:

  • 在 XAML 中创建 Xamarin.Forms ButtonCreate a Xamarin.Forms Button in XAML.
  • 响应被点击的 ButtonRespond to the Button being tapped.
  • 更改 Button 的外观。Change the appearance of the Button.

你将使用 Visual Studio 2019 或 Visual Studio for Mac 创建一个简单的应用程序,演示如何自定义 ButtonYou will use Visual Studio 2019, or Visual Studio for Mac, to create a simple application that demonstrates how to customize a Button. 以下屏幕截图显示了最终的应用程序:The following screenshots show the final application:

iOS 和 Android 上视觉外观已更改的按钮的屏幕截图Screenshot of a Button with a changed visual appearance, on iOS and Android