Mar*_*hal 5 c# wpf xaml listview scrollview
我ListView
里面有一个控件UserControl
.但是当内容溢出的大小时,尽管在XAML中设置了ListView
vertical ScrollBar
,但仍未启用vertical .
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>
Run Code Online (Sandbox Code Playgroud)
我也尝试将ListView
内部分组ScrollViewer
,但仍然无法正常工作.
非常感谢你提前:)
这看起来像
所以我认为容器有错误,因为没有限制ListView的大小,你把它放在哪里?确保容器有限制地布置控件.
归档时间: |
|
查看次数: |
8364 次 |
最近记录: |