当前位置: 首页 > news >正文

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>

 

http://www.youxuanlife.cn/news/151/

相关文章: