如何在标签页前添加内容页或视图
How to add content page or view before tabbed page
我想在TabbedPage
之前添加Page/View,我该怎么做?
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:TestProject.TabbedPages"
x:Class="TestProject.ItemPage"
Title = "Home Page">
<TabbedPage.Children>
<views:AprovedLeaves Title="Approved leaves"/>
<views:PendingLeaves Title="Pending leaves"/>
<views:DeniedLeaves Title="Denied leaves"/>
</TabbedPage.Children>
</TabbedPage>
上面的代码显示了这样的输出
但我需要一些 space 选项卡前。像这样
我建议您使用 Segmented Control Plugin 在 Nuget 上查找 Plugin.Segmented
并安装 Plugin.SegmentedControl.NetStandard
在 iOS 上初始化它,如下所示:
SegementedControlRenderer.Initialize();
然后像这样在XAML中使用它
<control:SegmentedControl x:Name="SegmentedControl" SelectedSegment="{Binding SegmentSelection}" TintColor="White" SelectedTextColor="BlueViolet" DisabledColor="Gray" Margin="8,8,8,8">
<control:SegmentedControl.Children>
<control:SegmentedControlOption Text="Item 1" />
<control:SegmentedControlOption Text="Item 2" />
<control:SegmentedControlOption Text="Item 3" />
<control:SegmentedControlOption Text="Item 4" />
</control:SegmentedControl.Children>
</control:SegmentedControl>
提供了分步指南
如有疑问,请随时回复
我想在TabbedPage
之前添加Page/View,我该怎么做?
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:TestProject.TabbedPages"
x:Class="TestProject.ItemPage"
Title = "Home Page">
<TabbedPage.Children>
<views:AprovedLeaves Title="Approved leaves"/>
<views:PendingLeaves Title="Pending leaves"/>
<views:DeniedLeaves Title="Denied leaves"/>
</TabbedPage.Children>
</TabbedPage>
上面的代码显示了这样的输出
但我需要一些 space 选项卡前。像这样
我建议您使用 Segmented Control Plugin 在 Nuget 上查找 Plugin.Segmented
并安装 Plugin.SegmentedControl.NetStandard
在 iOS 上初始化它,如下所示:
SegementedControlRenderer.Initialize();
然后像这样在XAML中使用它
<control:SegmentedControl x:Name="SegmentedControl" SelectedSegment="{Binding SegmentSelection}" TintColor="White" SelectedTextColor="BlueViolet" DisabledColor="Gray" Margin="8,8,8,8">
<control:SegmentedControl.Children>
<control:SegmentedControlOption Text="Item 1" />
<control:SegmentedControlOption Text="Item 2" />
<control:SegmentedControlOption Text="Item 3" />
<control:SegmentedControlOption Text="Item 4" />
</control:SegmentedControl.Children>
</control:SegmentedControl>
提供了分步指南
如有疑问,请随时回复