【问题标题】:How to create Carousel like control?如何创建类似轮播的控件?
【发布时间】:2012-01-16 10:51:48
【问题描述】:

我需要在我的 windows phone 7 APP 中使用“Сarousel like”控件,会有图像列表,我需要像 Pivot 中的项目一样切换它们。我应该使用什么控件? Pivot 非常相似,但我的应用程序中需要页脚。

【问题讨论】:

    标签: silverlight windows-phone-7 silverlight-4.0


    【解决方案1】:

    如果您(或其他任何在寻找花哨的 UI 元素时遇到这个问题的人)希望它更花哨,您也可以使用Silverlight Flow Layouts Library,这是一个非常强大的轮播系统,带有专用的 WP7 二进制文件。我自己还没有在 WP7 上使用过这个,但我已经将它与 WPF 一起使用过,它看起来不错,性能也很好。

    【讨论】:

      【解决方案2】:

      您可以在隐藏标题的地方使用Pivot 控件,我在这里写了一个简单的解决方案:

      A Windows Phone 7 Slide View with Page Pips

      您可以在 Pivot 控件下添加固定页脚,如下所示:

        <!--LayoutRoot is the root grid where all page content is placed-->
        <Grid x:Name="LayoutRoot" Background="#EAE5C7">
          <Grid.RowDefinitions>
             <RowDefinition/>
             <RowDefinition/>
          </Grid.RowDefinitions>
      
          <local:PivotLocationView Source="{Binding ElementName=pivot}"
                                   HorizontalAlignment="Center"
                                   VerticalAlignment="Bottom"
                                   Margin="0,0,0,10"/>
      
          <controls:Pivot Margin="0,-30,0,40" 
                          x:Name="pivot">
            <controls:PivotItem>
            ...
            </controls:PivotItem>
            <controls:PivotItem>
              ...
            </controls:PivotItem>
            <controls:PivotItem>
              ...
            </controls:PivotItem>
          </controls:Pivot>
      
          <!-- your fixed footer goes here -->
          <Grid x:Name="footer" Grid.Row="1">
          </Grid>
        </Grid>
      

      【讨论】:

      • 谢谢!枢轴下方可以有其他控件吗?我需要一些按钮不与图像一起列出。
      • @Horosho 是的,请参阅更新答案。如果这有帮助,请点赞。
      【解决方案3】:

      您可以尝试使用此Codeplex project Silverlight Carousel Control 中的控件 并希望它不使用任何非 WP7 功能。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-02-09
        • 2021-12-27
        • 2012-04-30
        • 2023-03-29
        • 2017-03-25
        • 1970-01-01
        • 1970-01-01
        • 2016-05-19
        相关资源
        最近更新 更多