答案 0 :(得分:0)
您可以使用SegmentedControl,Github here
像在iOS和Android项目中一样将其初始化:
Xamarin.Forms.Init();
SegmentedControlRenderer.Init();
获取以下名称空间:
xmlns:controls="clr-namespace:SegmentedControl.FormsPlugin.Abstractions;assembly=SegmentedControl.FormsPlugin.Abstractions"
然后像这样使用它:
<controls:SegmentedControl x:Name="SegControl" TintColor="#007AFF" SelectedSegment="0">
<controls:SegmentedControl.Children>
<controls:SegmentedControlOption Text="Tab 1" />
<controls:SegmentedControlOption Text="Tab 2" />
<controls:SegmentedControlOption Text="Tab 3" />
<controls:SegmentedControlOption Text="Tab 4" />
</controls:SegmentedControl.Children>
</controls:SegmentedControl>