简体   繁体   English

Xamarin.Forms 标签页错误

[英]Xamarin.Forms TabbedPage bug

I have created an application with Xamarin.Forms for android and ios.我用 Xamarin.Forms 为 android 和 Z9E304D4E8DF1B74CFA00991319 创建了一个应用程序。 On android everything works fine, but i have a little problem with ios.在 android 上一切正常,但我对 ios 有一点问题。 My app contains a TabbedPage that is composed of two different tabs.我的应用程序包含一个由两个不同选项卡组成的 TabbedPage。 Each tab is a content page and it has a listview inside it.每个选项卡都是一个内容页面,里面有一个列表视图。 This is the code:这是代码:

<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>

The problem is that second ListView in "page2" is frozen and I can't scroll it.问题是“page2”中的第二个 ListView 被冻结,我无法滚动它。 ListView in "page1" works correctly. “page1”中的 ListView 工作正常。 I've noticed, that when you use TabbedPage on IOS with 2 or more tabs and one of the tab contains ListView, then ListView is also frozen.我注意到,当您在 IOS 上使用带有 2 个或更多选项卡且其中一个选项卡包含 ListView 的 TabbedPage 时,ListView 也会被冻结。 Is it a bug or I've done something incorrectly?这是一个错误还是我做错了什么? Please help me请帮我

I found solution to my problem.我找到了解决我的问题的方法。 I've updated XF from 4.7 to the latest and everything works correct now on both platforms.我已将 XF 从 4.7 更新到最新版本,现在在两个平台上一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM