如何在xamarin.forms中设计带有3个按钮的标题

如何在xamarin.forms中设计带有3个按钮的标题,xamarin.forms,Xamarin.forms,我正在尝试设计类似whatsapp聊天页面的页眉,在页面右侧有3个按钮,分别是搜索、呼叫和carousal 我希望使用xamarin.forms在contentPage中设计相同的内容 我可以使用工具栏项添加carousal,但如何添加其他两个按钮(搜索和呼叫) 您可以使用工具栏项来实现这一点。只需添加其他项目 <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas

我正在尝试设计类似whatsapp聊天页面的页眉,在页面右侧有3个按钮,分别是搜索、呼叫和carousal

我希望使用xamarin.forms在contentPage中设计相同的内容

我可以使用工具栏项添加carousal,但如何添加其他两个按钮(搜索和呼叫)


您可以使用工具栏项来实现这一点。只需添加其他项目

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
        xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
        x:Class="ToolbarItems.Views.MainView">
 <ContentPage.ToolbarItems>
  <ToolbarItem Name="Menu1" Activated="OnClick"  Order="Primary" Priority="0" />
  <ToolbarItem Name="Menu2" Activated="OnClick"  Order="Primary" Priority="1" />
 </ContentPage.ToolbarItems>    
</ContentPage>

这将创建一些非常接近您在Android上想要的东西。但在iOS上,这看起来有点不同。如果您想获得类似的外观,您必须求助于自定义渲染器。

您可以使用工具栏项来实现这一点。只需添加其他项目

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
        xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
        x:Class="ToolbarItems.Views.MainView">
 <ContentPage.ToolbarItems>
  <ToolbarItem Name="Menu1" Activated="OnClick"  Order="Primary" Priority="0" />
  <ToolbarItem Name="Menu2" Activated="OnClick"  Order="Primary" Priority="1" />
 </ContentPage.ToolbarItems>    
</ContentPage>

这将创建一些非常接近您在Android上想要的东西。但在iOS上,这看起来有点不同。如果你想获得相似的外观,你必须求助于自定义渲染器。

你有自定义渲染器的例子吗你有自定义渲染器的例子吗