作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我在 UserControl
中有一个 ListView
控件。但是,当内容溢出 ListView
的大小时,垂直 ScrollBar
不会启用,尽管在 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
中,但仍然不起作用。
非常感谢您:)
最佳答案
这看起来像
所以我会假设容器有问题,因为它没有限制 ListView 的大小,你把它放在哪里了?确保容器布局控件时有限制。
关于c# - 没有为 ListView 启用 ScrollViewer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9066497/
我想知道有没有免费的PL/pgSQL开发环境。 在 Notepad++ 中编写代码,替换函数并运行它会使过程变慢。我目前正在使用 pgAdmin(仅用于替换和运行程序),但这不是我想要的。 我知道这里
我是一名优秀的程序员,十分优秀!