gpt4 book ai didi

silverlight - wp7 列表框弹跳 - 列表底部的项目

转载 作者:行者123 更新时间:2023-12-03 06:16:13 24 4
gpt4 key购买 nike

我注意到列表框中的最后一项无法自由向上滚动。当我试图将它们向上移动时,它们几乎“弹跳”。当我启用 SIP 时,效果会更差。我无法在屏幕上滚动底部项目。它们停留在屏幕底部,我看不到它们(或者它们被部分遮挡)。

关于如何纠正这种情况有什么想法吗?

    <ListBox VerticalAlignment="Top">
<Grid>

<TextBox Height="72" Margin="109,10,0,0" HorizontalAlignment="Left" Name="txt1" Text="" VerticalAlignment="Top" TextWrapping="Wrap" Width="341" InputScope="Text"/>
<TextBox Height="72" Margin="109,70,267,0" HorizontalAlignment="Left" Name="txt2" Text="0" VerticalAlignment="Top" Width="80" InputScope="Number" />
<TextBox Height="72" Margin="0,70,73,0" HorizontalAlignment="Right" Name="txt3" Text="0" VerticalAlignment="Top" Width="80" InputScope="Number"/>
<TextBox Height="131" Margin="12,160,0,0" HorizontalAlignment="Left" Name="txt4" Text="" VerticalAlignment="Top" TextWrapping="Wrap" Width="438" InputScope="Text"/>
<TextBox Height="72" Margin="12,320,0,147" HorizontalAlignment="Left" Name="txt5" Text="" VerticalAlignment="Top" Width="438" InputScope="Text"/>


<TextBlock Height="30" Margin="47,30,333,0" Name="lbl1" Text="Dosage" VerticalAlignment="Top" />
<TextBlock Height="30" Margin="10,90,332,0" Name="lbl2" Text="Quantity" VerticalAlignment="Top" />
<TextBlock Height="30" Margin="0,90,142,0" Name="lbl3" Text="Refills" VerticalAlignment="Top" HorizontalAlignment="Right"/>
<TextBlock Height="37" Margin="24,135,212,0" Name="lbl4" Text="Additional Instructions" VerticalAlignment="Top" />
<TextBlock Height="30" Margin="24,293,0,0" Name="lbl5" Text="Reason for Taking" HorizontalAlignment="Left" VerticalAlignment="Top" />
<TextBlock Height="30" Margin="24,385,0,0" Name="lbl6" Text="Consumption Frequency:" HorizontalAlignment="Left" VerticalAlignment="Top"/>


<TextBlock FontWeight="Bold" Height="30" HorizontalAlignment="Left" Margin="27,417,0,0" Name="lblday1" Text="Sun" VerticalAlignment="Top" Width="37" />
<TextBlock FontWeight="Bold" Height="30" HorizontalAlignment="Left" Margin="83,417,0,0" Name="lblday2" Text="Mon" VerticalAlignment="Top" Width="46" />
<TextBlock FontWeight="Bold" Height="30" HorizontalAlignment="Right" Margin="0,417,272,0" Name="lblday3" Text="Tue" VerticalAlignment="Top" Width="37" />
<TextBlock FontWeight="Bold" Height="30" HorizontalAlignment="Left" Margin="203,417,0,0" Name="lblday4" Text="Wed" VerticalAlignment="Top" Width="46" />
<TextBlock FontWeight="Bold" Height="30" HorizontalAlignment="Left" Margin="263,417,0,0" Name="lblday5" Text="Thur" VerticalAlignment="Top" Width="46" />
<TextBlock FontWeight="Bold" Height="30" HorizontalAlignment="Left" Margin="329,417,0,0" Name="lblday6" Text="Fri" VerticalAlignment="Top" Width="37" />
<TextBlock FontWeight="Bold" Height="30" HorizontalAlignment="Left" Margin="388,417,0,0" Name="lblday7" Text="Sat" VerticalAlignment="Top" Width="37" />


<CheckBox Content="CheckBox" Height="72" HorizontalAlignment="Left" Margin="15,431,0,0" Name="chkSun" VerticalAlignment="Top" VerticalContentAlignment="Top" Width="59" />
<CheckBox Content="CheckBox" Height="72" HorizontalAlignment="Left" Margin="75,431,0,0" Name="chkMon" VerticalAlignment="Top" VerticalContentAlignment="Top" Width="59" />
<CheckBox Content="CheckBox" Height="72" HorizontalAlignment="Left" Margin="135,431,0,0" Name="chkTue" VerticalAlignment="Top" VerticalContentAlignment="Top" Width="59" />
<CheckBox Content="CheckBox" Height="72" HorizontalAlignment="Right" Margin="0,431,202,0" Name="chkWed" VerticalAlignment="Top" VerticalContentAlignment="Top" Width="59" />
<CheckBox Content="CheckBox" Height="72" HorizontalAlignment="Left" Margin="255,431,0,0" Name="chkThu" VerticalAlignment="Top" VerticalContentAlignment="Top" Width="59" />
<CheckBox Content="CheckBox" Height="72" HorizontalAlignment="Left" Margin="315,431,0,0" Name="chkFri" VerticalAlignment="Top" VerticalContentAlignment="Top" Width="59" />
<CheckBox Content="CheckBox" Height="72" HorizontalAlignment="Left" Margin="375,431,0,0" Name="chkSat" VerticalAlignment="Top" VerticalContentAlignment="Top" Width="59" />

</Grid>
</ListBox>

更新:

好吧,我回答了我自己的问题。至少我找到了自己问题的初步答案。我纠正弹跳的方法是修改 .

中的 height 属性。
<Grid Height="800">

现在,当 SIP 处于事件状态时,底部项目可见,并有足够的空闲空间。正如我上面所说,我找到了答案。我不知道这是否是正确的答案。如果您有更好的方法,请告诉我。

当我测试这个时,是的,当 SIP 处于事件状态时,我最初可以自由移动到底部。然而,当我移动尝试向后移动时,我再次获得弹跳效果。我需要添加一些东西才能让它自由地上下移动吗?

最佳答案

一般的问题是列表框不知道它有多高。当然,您可以通过在其父级上设置明确的高度来解决它。更好的方法是在网格中为其定义一行:

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ListBox Grid.Row="0">
...
</ListBox>
</Grid>

Height="*"表示该行应占据其容器的整个空间。

关于silverlight - wp7 列表框弹跳 - 列表底部的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4977610/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com