我想要在屏幕上显示大约 800 KB 的文本。有人可以让我知道这个问题的可能解决方案吗?
由于文本块的 2048X2048 限制,我已经尝试将文本拆分为多个文本块,并且也尝试过http://blogs.msdn.com/b/priozersk/archive/2010/09/08/creating-scrollable-textblock-for-wp7.aspx http://blogs.msdn.com/b/priozersk/archive/2010/09/08/creating-scrollable-textblock-for-wp7.aspx。虽然这适用于 40 到 50 KB 的数据,但无法扩展到 800 KB 的大小。
我还尝试过使用列表框(如下面帖子的第一个解决方案中所述)。wp7 - 带有大量文本的 TextBlock - 巨大的内存使用 - 如何避免它? https://stackoverflow.com/questions/4853264/wp7-textblock-with-a-lot-of-text-huge-memory-usage-how-to-avoid-it
这(如下所示)在 80-100KB 之前也有效,之后加载文本需要很长时间。
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<ListBox x:Name="myListBox" Width="468" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock FontSize="20" Text="{Binding}" TextWrapping="Wrap" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
In 溢出7 https://stackapps.com/questions/1942/overflow7-stack-exchange-sites-on-windows-phone-7我对文本使用 ListBox 方法 - 但我同意有时可能需要很长时间才能加载。
In Iron7 http://www.wp7comp.com/iron7,我使用在 WebBrowser 控件中显示的 HTML 页面。
另一项建议是,如果您有很多文本,那么您可以看看 Kindle 如何显示文本 -Windows Phone 7 版 Kindle 中使用的控件是什么 https://stackoverflow.com/questions/5267543/whats-the-control-used-in-kindle-for-windows-phone-7
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)