我想在之前添加页面/视图TabbedPage
, 我怎样才能做到这一点?
<?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>
上面的代码显示这样的输出
但我需要在制表符之前留出一些空间。像这样
我建议您使用分段控制插件来进行此查找Plugin.Segmented
在 Nuget 上并安装 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>
对此提供了分步指南C# 角博客 https://www.c-sharpcorner.com/article/segment-control-in-xamarin-forms/
如有疑问,请随时回复
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)