Xamarin.From ContentView 自定义标题栏
添加自定义标题栏
public partial class Main : ContentPage { public Main() { InitializeComponent(); // 添加标题栏 NavigationPage.SetTitleView(this, new TitleView()); } }
定义标题栏
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="PileShow.View.TitleView"> <ContentView.Content> <StackLayout Orientation="Horizontal"> <StackLayout HorizontalOptions="EndAndExpand"> <Label Text="{Binding Time}" FontSize="21"/> </StackLayout> </StackLayout> </ContentView.Content> </ContentView>
浙公网安备 33010602011771号