Windows Phone ListBox无法滚动到底部
来源:互联网 发布:在线制作淘宝店铺标志 编辑:程序博客网 时间:2024/06/15 19:25
1.
ListBox无法滚动到底部,原因是Listbox它不知道自己有多高,所以需要添加以下代码。
<ListBox x:Name=”lstboxTasks” HorizontalContentAlignment=”Stretch” Height=”{Binding ElementName=LayoutRoot, Path=ActualHeight, Mode=OneWay}” ItemsSource=”{Binding Tasks}” Grid.Row=”1″>
注意红色部分,将LayoutRoot的实际高度与之绑定,告诉Listbox你有多高
2.
The key to scrolling is the Height value of the ScrollViewer or ListBox (with its built-in ScrollViewer). The Height should be set to the desired viewport size on the screen. You can set Height to an explicit number, but you can have Silverlight set it to the available height on the screen. Do this by putting the ScrollViewer or ListBox in a Grid row that has Height="*".
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <TextBox Grid.Row="0" Height="72" HorizontalAlignment="Left" Margin="0" Name="filter" Text="search" VerticalAlignment="Top" Width="458" LostFocus="filter_LostFocus" GotFocus="filter_GotFocus" Foreground="Gray" TextChanged="filter_TextChanged" /> <ListBox Grid.Row="1" HorizontalAlignment="Left" Margin="0,12,0,0" Name="people" VerticalAlignment="Top"> <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding BuiltName}" Style="{StaticResource PhoneTextLargeStyle}"/> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Grid>
Row 0 of the grid has Height="Auto" which means its height will expand to the total height of its contents. Row 1 of the grid has Height="*" which means it will be set to the remaining available height on the screen.
More information about Grid row height: RowDefinition.Height Property
0 0
- Windows Phone ListBox无法滚动到底部
- VS2010 C# ListBox 自动滚动到底部
- C# ListBox 自动滚动到底部
- 使用依赖属性实现监视ListBox滚动到底部
- Windows Phone 7 如何判断ListBox控件滚动到底
- Windows Phone listBox
- ScrollView无法完全滚动到底部解决方法
- 如何在ListBox中添加控件后让ListBox滚动到最底部
- windows phone:【listBox】WP7 中最好的ListBox 滚动后分批加载的方法
- ListBox无法滚动
- winfrom中ListBox自动滚动到底部,并设置单行文字颜色
- WP7判断ListBox依据滚动至底部
- ios 内层滚动到顶部或者底部无法滑动问题
- uitableview 滚动到底部
- 滚动条到底部
- webview滚动到底部
- uitableview 滚动到底部
- ScrollView滚动到底部
- 总结一下移动操作系统(2014年6月)
- HDU1232畅通工程
- 常见的麦克风供电方式总结(幻象供电)
- 当你学不进去的时候,试试“普瑞馬”法则
- linux修改键盘按键
- Windows Phone ListBox无法滚动到底部
- 设置后,让迅雷不再偷着上传,不再占多资源,不再卡
- 常见的麦克风供电方式总结(4mA 电流源供电)
- javaScript 编程工具Aptana 安装
- C#基础
- 黑马程序员___13java基础 集合框架 LIST和SET集合
- Eclipse中的常用快捷键
- URLEncode和URLDecode
- mysql中safe-updates的限制