【问题标题】:WinRT element rendering bugWinRT 元素渲染错误
【发布时间】:2016-07-04 12:32:26
【问题描述】:

我在 WinRT 应用程序上渲染某些元素时遇到了一个小问题。

页面已加载,但我的列表视图的元素随机变暗了几秒钟。有时它们显示为灰色,有时它们很好。

有关信息,我使用图像作为我的列表视图项目背景(我的图像重量 = 4ko)。 我也尝试给他们一个固定的 Width 和固定的 DecodePixelWith 但它没有改变任何东西。

有解决此问题的提示吗? screen shot example of my bug

谢谢大家:p

【问题讨论】:

  • 完成:p 我仍然有同样的问题,并且它开始发生在其他列表视图中......任何人都可以帮助我吗?我为他祈祷我的上帝:)

标签: windows xaml windows-runtime winrt-xaml


【解决方案1】:

这是数据模板(这是我的 XAML 代码的一个简短示例)

<DataTemplate x:Key="ListViewIntervention">
                <Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="170" />
                        </Grid.ColumnDefinitions>
                        <Image Grid.Column="0" Grid.ColumnSpan="2"  NineGrid="50,50,170,50" Stretch="Fill">
                            <Image.Source>
                                <BitmapImage  UriSource="ms-appx:///Assets/Shadow/ListViewUnplanned.png"
                             DecodePixelWidth="1200" 
                             DecodePixelType="Physical"/>
                            </Image.Source>
                        </Image>
                    </Grid>
                   <Grid x:Name="grid_with_some_buttons>
                   </Grid>
                </Grid>
        </DataTemplate>

还有我的列表视图:

        <ListView
            Name="DataListView" Grid.Row="2"
            Margin="35,10,15,0" IsSwipeEnabled="False"
            ItemTemplate="{StaticResource ListViewIntervention}"
            ItemsSource="{Binding InterventionsCollection}"
            ScrollViewer.HorizontalScrollMode="Disabled" SelectionMode="Single">
        </ListView>

Atm 我的 listView 包含 350 个项目。

【讨论】:

  • 请编辑问题而不是写答案。
猜你喜欢
  • 1970-01-01
  • 2020-04-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-10
  • 2016-02-06
相关资源
最近更新 更多