0

图片:

图片

我想在 Xamarin 表单中向工具栏添加一个框架。但工具栏不接受。

4

1 回答 1

0

您不能将框架添加为工具栏项。

例如,您可以使用 TitleView 并自己自定义整个 NavigationView。

例如:

 <?xml version="1.0" encoding="utf-8" ?>
<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>
        <StackLayout Orientation="Horizontal">
             <Label Text="Hello World" HorizontalOptions="Center"/>
            <Frame BackgroundColor="Yellow" HorizontalOptions="End"/>
        </StackLayout>
    </NavigationPage.TitleView>

</ContentPage>
于 2019-08-24T08:11:29.477 回答