我想在 WPF 中将一个可滚动的容器放在图像的顶部或图像内部。 然后用户将能够滚动容器,而图像将被固定。我不想实现的是模拟智能手机的内容。在这张图片中,智能手机是图片,容器似乎在这张图片中:
最好的做法是什么?
谢谢!
最佳答案
您可以将容器放在 ScrollViewer 标签内:
<Window x:Class="WpfApplication2.Test"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Test"
Height="300"
Width="300">
<Grid>
<ScrollViewer HorizontalAlignment="Left" Height="299" Margin="10,10,0,0"
VerticalAlignment="Top" Width="497">
<StackPanel>
//Contorls like image ,button etc
</StackPanel>
</ScrollViewer>
</Grid>
关于c# - 图像的一部分内的 WPF ScrollableViewer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35157478/