xamarin.forms add switch in toolbar
问题 Is it possible to add a switch on the toolbar? <ContentPage.ToolbarItems> <ToolbarItem> <Switch x:Name="Switch1" IsToggled="True" Margin="5,0,0,0"/> </ToolbarItem> </ContentPage.ToolbarItems> Does anybody have any ideas? Thanks! 回答1: <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:TitleViewSample" x:Class="TitleViewSample.MainPage"> <NavigationPage.TitleView> <Switch x:Name="Switch1" IsToggled="True"