我有一个包含对象的列表框,但我无法滚动到页面底部。问题是什么?这是我正在使用的代码。
<Grid>
<Image Name="Nietcomment" Source="write.png" Width="70" Margin="350,-850,0,0" Tap="Login_popup" Visibility="Visible"/>
<Image Name="welcomment" Source="write2.png" Width="70" Margin="350,-850,0,0" Tap="Login_popup_remove" Visibility="Collapsed"/>
<ScrollViewer Name="scrollview" VerticalScrollBarVisibility="Visible" Margin="0,0,0,0" Foreground="Black">
<StackPanel>
<TextBlock x:Name="NTitelComment" Text="{Binding}" TextWrapping="Wrap" FontSize="25" Margin="10,0,10,0" Foreground="#FFE5001b"/>
<Line Stretch="Fill" Stroke="Black" X1="0" X2="1" Y1="0" Y2="0" Margin="10,0,10,0"/>
<TextBlock x:Name="tijdComment" Text="{Binding}" Margin="50,0,10,0" Foreground="Black"/>
<Image Height="20" Width="20" Margin="-380,-20,0,0" Source="/PostDateIcon.png"/>
<ListBox Margin="0,0,0,20" Name="lbComments" VerticalAlignment="Top" />
</StackPanel>
</ScrollViewer>
</Grid>
最佳答案
如果您在 ScrollViewer 周围放置一个边框,您能看到它是否超出了屏幕范围吗?设置 Grid 或 ScrollViewer 的固定高度会有帮助吗? 请记住,手机内置了滚动条,因此您的 ScrollViewer 可能无法正常使用它。
关于c# - 无法滚动到底部 wpf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22689478/