这就是我的 wp8.1 应用程序的内容:我有一个堆栈面板,其中包含(从上到下)一个水平列表框、一个数据透视表和数据透视表中的列表框。我正在尝试向下滚动枢轴中包含的列表框。我已经设法通过为列表框设置固定高度来做到这一点,但显示需要可缩放到任何屏幕高度,因此需要将列表框高度设置为自动。但这使它不可滚动:/有什么办法可以让它工作吗?
最佳答案
您不能使用自动高度滚动列表框。您可以使用带有行定义的网格而不是堆栈面板来包含列表框。例子是这样的:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="100" /><!--this is for any item above your listbox-->
<RowDefinition Height="*" /><!--This is for your listbox so it can occupy the space left from the grid-->
</Grid.RowDefinitions>
<Pivot Grid.Row="0" />
<ListBox Grid.Row="1" ItemsSource={Binding Something} />
</Grid>
关于c# - 在堆栈面板中滚动列表框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30954213/