如何解决在Xamarin表单TabbedPage
我有一个要求,例如在TabbedPage中添加更多的选项卡。最初它的数量是5且工作正常。而我又添加了一个选项卡(例如6th),则该应用的Android版本触发了'illegalArgumentException'
IOS版本不会触发任何错误,而是将标签从第5个位置加载到外观不太好的新列表视图中。
对此表示赞赏。
解决方法
如何使用按钮和图标字体代替tabbedPage? 您可以显示6个或更多按钮。
xaml
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Put contents here -->
<StackLayout Grid.Row="0"
Orientation="Horizontal" HorizontalOptions="FillAndExpand" VerticalOptions="End"
>
<Button FontFamily="{DynamicResource MaterialFontFamily}"
Text="󱔔" FontSize="Large" TextColor="Blue"
HorizontalOptions="CenterAndExpand" BackgroundColor="Transparent" />
<Button FontFamily="{DynamicResource MaterialFontFamily}"
Text="󱔓" FontSize="Large" TextColor="Blue"
HorizontalOptions="CenterAndExpand" BackgroundColor="Transparent" />
<Button FontFamily="{DynamicResource MaterialFontFamily}"
Text="󱔒" FontSize="Large" TextColor="Blue"
HorizontalOptions="CenterAndExpand" BackgroundColor="Transparent" />
<Button FontFamily="{DynamicResource MaterialFontFamily}"
Text="󱔑" FontSize="Large" TextColor="Blue"
HorizontalOptions="CenterAndExpand" BackgroundColor="Transparent" />
<Button FontFamily="{StaticResource MaterialFontFamily}"
Text="󱖌" FontSize="Large" TextColor="Blue"
HorizontalOptions="CenterAndExpand" BackgroundColor="Transparent" />
<Button FontFamily="{DynamicResource MaterialFontFamily}"
Text="󱕃" FontSize="Large" TextColor="Blue"
HorizontalOptions="CenterAndExpand" BackgroundColor="Transparent"/>
</StackLayout>
</Grid>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。