【发布时间】:2014-06-08 08:32:00
【问题描述】:
问题:当我在TextBox 中输入大文本时,我在TextBox 中输入时看不到指针
说明:
- 每当用户在
TextBox中输入文本时,如果输入的文本很大,则应启用滚动。 -
ScrollViewer仅在ScrollViewer的高度内显示TextBox的内容 - 当我输入几行文本时出现问题(指针不可见)
- 然后我向下滚动查看指针,再输入几行后问题再次出现
代码:
<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 Text="Scroll Content Inside Textbox" Style="{StaticResource PhoneTextNormalStyle}" Margin="25,0,180,0"/>
</StackPanel>
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<ScrollViewer Height="200"
VerticalAlignment="Top">
<TextBox x:Name="txtBody"
Width="200"
AcceptsReturn="True"
/>
</ScrollViewer>
</Grid>
</Grid>
【问题讨论】:
-
这是我针对同样问题的帖子...stackoverflow.com/questions/23208133/…
-
在您的解决方案中,同样的问题出现在 11 行之后
标签: c# xaml windows-phone-8 scrollviewer