【问题标题】:Listview/listbox scroll stop workListview/listbox 滚动停止工作
【发布时间】:2015-04-10 02:43:46
【问题描述】:

我需要这样的布局。

<Page>...
    <Grid>
      <Grid..definitions/> 
        <StackPanel>
          ...HeaderScreen Layout here
        <StackPanel>
        <ListView> (or Listbox)
           ... My listItemTemplate here...
        </ListView> (or /Listbox)
    </Grid>
</Page>

按顺序,当我使用此结构时,列表视图不会滚动。删除“StackPanel”块,滚动工作完美。 我尝试使用“网格”,但它也不起作用。 我需要在这个屏幕上修复标题。

编辑 - 解决方案

当我将&lt;RowDefinition Height="auto"/&gt; 替换为&lt;RowDefinition Height="*"/&gt; 时,我的代码可以工作

【问题讨论】:

    标签: listview windows-phone-8 listbox windows-phone-8.1 stackpanel


    【解决方案1】:

    ListBox 需要固定高度才能滚动。如果您在带有Height = "Auto" 的网格行内或在StackPanel 内给出了ListBox,则ListBox 将尝试根据需要获取大小。这将阻止滚动。如果您给定了一个固定的高度,它将仅采用该大小并通过滚动显示其中的其余项目。

    【讨论】:

    • 嗨@Bells,谢谢你的帮助。我在 RowDefitnitions 中使用“*”修复
    猜你喜欢
    • 1970-01-01
    • 2011-09-16
    • 2013-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-31
    • 1970-01-01
    相关资源
    最近更新 更多