滚动查看器SIP问题(WP7.5芒果) [英] Scrollviewer & SIP Issue (WP7.5 Mango)
问题描述
我正在处理包含注册表的应用程序.该表单包含多个文本输入框,因此使用ScrollViewer允许它们全部显示在一页上.
I am working on an application which includes a registration form. The form contains multiple text entry boxes, and so a ScrollViewer is used to allow them all to be displayed on one page.
以下是我正在使用的XAML代码的精简示例:
The following is a stripped down example of the XAML code I am using:
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock x:Name="ApplicationTitle" Text="SCROLLVIEWER TEST" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock x:Name="PageTitle" Text="registration" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<ScrollViewer Grid.Row="1">
<StackPanel>
<TextBlock Text="Hello" Margin="12,0,0,0"/>
<TextBox />
<TextBlock Text="Hello1" Margin="12,0,0,0"/>
<TextBox />
<TextBlock Text="Hello2" Margin="12,0,0,0"/>
<TextBox />
<TextBlock Text="Hello3" Margin="12,0,0,0"/>
<TextBox />
<TextBlock Text="Hello4" Margin="12,0,0,0"/>
<TextBox />
<TextBlock Text="Hello5" Margin="12,0,0,0"/>
<TextBox />
<TextBlock Text="Hello6" Margin="12,0,0,0"/>
<TextBox />
<TextBlock Text="Hello7" Margin="12,0,0,0"/>
<TextBox />
<TextBlock Text="Hello8" Margin="12,0,0,0"/>
<TextBox />
<TextBlock Text="END" Margin="12,0,0,0"/>
<TextBox />
</StackPanel>
</ScrollViewer>
</Grid>
(请注意,ScrollViewer在网格单元内,这意味着标题面板应始终保持在屏幕上)
(Note that the ScrollViewer is inside a grid cell, which means that the title panel should stay OnScreen at all times)
滚动效果很好,所以这不是问题.但是,当用户选择文本框输入数据时(即,软键盘打开),系统会将整个页面的内容(包括注册标题面板)推送到周围,这是不希望的行为. [请参阅Windows Phone上的人脉"应用,然后尝试添加新联系人.它包含类似的结构,但ScrollViewer的行为仅通过向上滚动scrollviewer中的内容才能正确执行.]
The scrolling works perfectly fine, so that is not an issue. However, when the user selects a TextBox to enter data (i.e. the soft keyboard opens), the system pushes the content of the entire page around (including the registration title panel), which is not expected behaviour. [See the People app on Windows Phone and try adding a new contact. This contains a similar structure, but the ScrollViewer behaves correctly by only pushing content in the scrollviewer up]
测试用例
- 选择一个在屏幕顶部附近可见的文本框,以打开键盘.
- 尝试在键盘打开的情况下滚动到页面底部.
- 页面底部的项目无法访问.
或
- 选择一个在屏幕底部附近可见的文本框.
- 整个页面的内容被上推.
- 尝试在键盘打开的情况下滚动到页面顶部.
- 页面顶部的项目无法访问,并且在关闭键盘之前,标题面板永远不会回到视图中.
对于解决此问题的任何帮助,将不胜感激.谢谢.
Any help on resolving this issue would be appreciated. Thanks.
推荐答案
请看看我的小型图书馆- https://siphelper.codeplex.com/
Have a look at my small library please - https://siphelper.codeplex.com/
它可以修改scrollviewer的高度,并且可以将内容滚动到最高/最低点.
It modifies height of scrollviewer and content can be scrolled to the topmost/bottommost point.
如果您有任何建议,请随时与我联系.
If you have any suggestions - feel free to contact me.
这篇关于滚动查看器SIP问题(WP7.5芒果)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!