<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <FlipView x:Name="flipview" Width="240" Height="120" SelectedIndex="0"> <Image Width="240" Height="120" Source="Images/1.jpg" Stretch="Fill"> </Image> <Image Width="240" Height="120" Source="Images/1.jpg" Stretch="Fill"> </Image> <Image Width="240" Height="120" Source="Images/1.jpg" Stretch="Fill"> </Image> <Image Width="240" Height="120" Source="Images/1.jpg" Stretch="Fill"> </Image> <Image Width="240" Height="120" Source="Images/1.jpg" Stretch="Fill"> </Image> </FlipView> <Hub Header="Hub"> <HubSection Header="HubSection 0"> <DataTemplate> </DataTemplate> </HubSection> <HubSection Header="HubSection 1"> <DataTemplate> <Grid/> </DataTemplate> </HubSection> </Hub> </Grid>
<Hub Header="Hub"> <HubSection Header="HubSection 0"> <DataTemplate> <FlipView x:Name="flipview" Width="240" Height="120" SelectedIndex="0"> <Image Width="240" Height="120" Source="Images/1.jpg" Stretch="Fill"> </Image> <Image Width="240" Height="120" Source="Images/1.jpg" Stretch="Fill"> </Image> <Image Width="240" Height="120" Source="Images/1.jpg" Stretch="Fill"> </Image> <Image Width="240" Height="120" Source="Images/1.jpg" Stretch="Fill"> </Image> <Image Width="240" Height="120" Source="Images/1.jpg" Stretch="Fill"> </Image> </FlipView> </DataTemplate> </HubSection> <HubSection Header="HubSection 1"> <DataTemplate> <Grid/> </DataTemplate> </HubSection> </Hub>
flipview丢失了
Hub和FlipView都是切换页面局部区域的效果,建议不要相互嵌套使用。
代码段1:
FilpView和Hub都在Grid当中,Hub在上,将FilpView遮挡,没有效果。
跟楼主说的“一切正常”不同。
代码段2:
FilpView嵌入到Hub的第一个HubSection,显示正常。
专注于Windows Platform Development