积极答复者
listview中的文字在surface屏幕转换方向后会消失,但是在模拟器上显示的确实正常,Bob能不能给解决下?谢谢

问题
-
我随便写了一个小例子,就是先将屏幕分成两列,然后在左边的那一列中放一个listview,listview里面随便放几项文字,运行后在模拟器上正常,变换方向后listview中的文字显示正常,但部署到surface上后,刚开始显示是正常的,变换surface的方向后,listview中的文字就不见了,需要触摸一下listview所在的那块屏幕,文字才能显示出来,或者是从横屏转换到竖屏的时候,listview跑到左侧那一列的中间位置了,本来是应该显示在左侧的顶部的,需要触摸一下顶部listview才能回到应该在的位置!大家有没有遇到过类似的情况,求解决!!!
下面是我的几行代码,大家可以看下:
<Grid Background="White" x:Name="LayoutRoot">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="330"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions><!--左侧边栏-->
<Grid Background="#FFF5F7F7" Grid.Column="0" x:Name="LeftSpan">
<ListView VerticalAlignment="Top"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollMode="Disabled" SelectionMode="Single"
HorizontalAlignment="Left" >
<x:String>Item 1</x:String>
<x:String>Item 2</x:String>
<x:String>Item 3</x:String>
<x:String>Item 4</x:String>
</ListView>
</Grid></Grid>
答案
-
Hi,
个人认为代码没什么问题,你可以试试删掉 VerticalAlignment和HorizontalAlignment。因为这里没有Surface没有办法测试问题,如果还是有问题你可以到这里用英文发帖提问:
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/threads
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- 已标记为答案 BestRabbit 2012年12月28日 10:03
-
全部回复
-
Hi,
个人认为代码没什么问题,你可以试试删掉 VerticalAlignment和HorizontalAlignment。因为这里没有Surface没有办法测试问题,如果还是有问题你可以到这里用英文发帖提问:
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/threads
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- 已标记为答案 BestRabbit 2012年12月28日 10:03
-