对于ListView控件未启用的ScrollViewer [英] ScrollViewer not enabled for ListView

查看:149
本文介绍了对于ListView控件未启用的ScrollViewer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在用户控件 A 的ListView 控制。但是,当的ListView 的内容溢出大小,纵向滚动条未启用,尽管在XAML中设置它。

I have a ListView control inside UserControl. But when content overflows size of the ListView, vertical ScrollBar is not enabled, despite of setting it in XAML.

XAML如下所示:

<UserControl x:Class="GrandSuccessProject.View.ContactsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="367" d:DesignWidth="548" Background="{x:Null}" VerticalContentAlignment="Top">

<ListView ScrollViewer.CanContentScroll="True" 
          ScrollViewer.VerticalScrollBarVisibility="Visible" 
          ItemsSource="{Binding SelectedContacts}"  
          ItemContainerStyle="{StaticResource ContainerStyle}" 
          Grid.Row="1" 
          VerticalAlignment="Top" 
          VerticalContentAlignment="Top" />      

</UserControl>



我也试过分组的的ListView 里面的ScrollViewer ,但仍然无法正常工作

I also tried grouping the ListView inside a ScrollViewer, but still doesn't work.

非常感谢你提前:)

推荐答案

这看起来像


  1. ListView控件把所有的它需要的所有物品的空间,因此滚动是禁用的。

  2. ListView控件超出其容器的边界。

所以我会假设容器有过错不限制ListView控件的大小,你在哪里把它?确保容器将控件与限制。

So i would assume that the container is at fault for not restricting the size of the ListView, where did you place it? Make sure the container lays out the controls with limitations.

这篇关于对于ListView控件未启用的ScrollViewer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆