【问题标题】:How to set the scroll property in the tabbedpage如何在标签页中设置滚动属性
【发布时间】:2022-03-02 09:56:44
【问题描述】:

我创建了一个标签页来在页面底部创建一个水平菜单,但我无法设置滚动属性。 这是我的代码:

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         x:Class="GET_SOUND.Views.MenuPage"
        xmlns:local="clr-namespace:GET_SOUND.Views"
        xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
        android:TabbedPage.ToolbarPlacement="Bottom"
        android:TabbedPage.IsSmoothScrollEnabled="True"
        BarBackgroundColor="{StaticResource Primary}"
        SelectedTabColor="Orange"
        UnselectedTabColor="#95FFFFFF">
<!--Pages can be added as references or inline-->
<local:Dashboard Title="Dashboard" Icon="dashboard" />
<local:Marchi Title="Marchi" Icon="marchi" />
<local:Isrc Title="Isrc" Icon="matrici" />
<local:Documenti Title="Documenti" Icon="documenti" />
<local:Documenti Title="Impostazioni" Icon="imp" />
<local:Anagrafica Title="Anagrafica" Icon="anagrafica" />
<local:OpereTutelate Title="Opere Tutelate" Icon="opere" />

我尝试插入 -> App: tabmode = "Scrollable" 和程序集,正如 question 中所建议的那样,但它给了我一个错误,我不明白为什么

【问题讨论】:

标签: xamarin.forms scroll tabbedpage


【解决方案1】:

作为建议,您可以尝试使用 Shell Tab,正如文档中所说:

当 TabBar 上的选项卡超过五个时,更多选项卡将 出现,可用于访问其他选项卡

而且 Xamarin.Community 也是一个选项,您可以使用 TabStripPlacement="Bottom" 设置底部的可滚动选项卡。您可以在https://github.com/xamarin/XamarinCommunityToolkit/blob/main/samples/XCT.Sample/Pages/Views/TabView/ScrollTabsPage.xaml

中查看更多信息

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-16
    • 1970-01-01
    • 1970-01-01
    • 2011-03-12
    • 1970-01-01
    • 2023-02-18
    相关资源
    最近更新 更多