如何解决Xamarin.Forms TabbedPage 错误
我使用 Xamarin.Forms 为 android 和 ios 创建了一个应用程序。在 android 上一切正常,但我对 ios 有一点问题。我的应用程序包含一个由两个不同选项卡组成的 TabbedPage。每个选项卡都是一个内容页面,其中有一个列表视图。这是代码:
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Class="MyApp.Views">
<TabbedPage.Children>
<ContentPage x:Name="page1">
<ContentPage.toolbaritems>
<ToolbarItem Icon="more.png" Clicked="ToolbarItem_Clicked"/>
</ContentPage.toolbaritems>
<ListView ItemsSource="{Binding JobsTodo}"
x:Name="listView"
VerticalScrollBarVisibility="Always"
RowHeight="240"
SeparatorColor="Transparent"
BackgroundColor="#fffffd"
SelectionMode="None" ItemTemplate="{StaticResource startJob}" />
</ContentPage>
<ContentPage x:Name="page2">
<ListView
ItemsSource="{Binding JobsEnded}"
VerticalScrollBarVisibility="Always"
RowHeight="240"
SeparatorColor="#4b4b4b"
BackgroundColor="#fffffd"
SelectionMode="None" ItemTemplate="{StaticResource endJob}" />
</ContentPage>
</TabbedPage.Children>
问题是“page2”中的第二个 ListView 被冻结,我无法滚动它。 “page1”中的 ListView 工作正常。我注意到,当您在具有 2 个或更多选项卡的 IOS 上使用 TabbedPage 并且其中一个选项卡包含 ListView 时,ListView 也会被冻结。这是一个错误还是我做错了什么?请帮帮我
解决方法
我找到了解决问题的方法。我已将 XF 从 4.7 更新到最新版本,现在在两个平台上一切正常。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。