本文介绍了Scrollview 中的 Xamarin Forms Listview 不滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         x:Class="Dh.ListPage">
<ContentPage.Content>
    <ScrollView>
        <StackLayout Style="{StaticResource MainStackLayoutWhenLoggedInStyle}">
            <Frame Style="{StaticResource FrameStyle2}">
                <StackLayout>
                    <Label Text="Vragenlijsten" Style="{StaticResource TitelLabelStyle}" />
                </StackLayout>
            </Frame>
            <Frame Style="{StaticResource FrameStyle2}">
                <StackLayout>
                    <Label Text="DRINGENDE VRAGEN: vul deze vragen meteen in!" Style="{StaticResource StandardLabelStyle}"/>
                    <Frame Style="{StaticResource FrameStyle2}">
                        <StackLayout Style="{StaticResource ListViewStackLayoutStyle}" >
                            <ListView ItemTapped="OnItemTapped" ItemsSource="{Binding Question_Lists}" Style="{StaticResource StandardListViewStyle}">
                                <ListView.ItemTemplate>
                                    <DataTemplate>
                                        <ViewCell>
                                            <ViewCell.View>
                                                <Label Text="{Binding Title}" Style="{StaticResource StandardLabelStyle}" />
                                            </ViewCell.View>
                                        </ViewCell>
                                    </DataTemplate>
                                </ListView.ItemTemplate>
                            </ListView>
                        </StackLayout>
                    </Frame>
                </StackLayout>
            </Frame>
        </StackLayout>
    </ScrollView>
</ContentPage.Content>

当我的屏幕太小时,我的列表视图不想滚动.如果我的屏幕不是太小,那么 listview 会滚动.有人可以帮我吗?

When my screen is too small then my listview does not want to scroll. If my screen is not too small then listview does scroll. Can someone help me pls?

推荐答案

切勿在 ScrollView 内堆叠 ListView,因为它们至少在 Android 上都实现了滚动.

Never stack a ListView inside a ScrollView as both implement scrolling on Android at least.

这篇关于Scrollview 中的 Xamarin Forms Listview 不滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 09:09