XF 操作表

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace App25
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
        }

        async void Button_Clicked(object sender, EventArgs e)
        {
            var actionSheet = await DisplayActionSheet("更改界面颜色", "Cancel", "Red", "Blue", "Yellow");
            if (actionSheet == "Red")
            {
                this.BackgroundColor = Color.Red;
            }
            else if (actionSheet == "Blue")
            {
                this.BackgroundColor = Color.Blue;
            }
            else
            {
                this.BackgroundColor = Color.Yellow;
            }
        }
    }
}
 

猜你喜欢

转载自blog.csdn.net/dxm809/article/details/81462261