最佳答案
Carousel Page not appearing in Xamarin.Forms template
随着 Xamarin.Forms
2.2.0
的发布,我们现在有了 CarouselView
,它是 CarouselPage< 的替代品
。 CarouselPage
将在未来版本中被标记为已弃用。这就是 CarouselPage
模板被删除的原因。您可以在 Xamarin.Forms
release notes 中找到它。
此外,您还可以看到 Jason Smith 在 Evolve 上发表的演讲,他特别指出您不应该使用 CarouselPage
,而应该使用 CarouselView
: https://youtu.be/RZvdql3Ev0E
CarouselView
CarouselView is intended to fully replace CarouselPage. CarouselPage will be deprecated in a future release. CarouselView is superior in many ways, including its ability to be virtualized and nested within layouts.
正如 SushiHangover 有 pointed out :
Xamarin.Forms
CarouselPage
不支持 UI 虚拟化(回收)。
初始化性能和内存使用可能会成为问题,具体取决于页面/子项的数量。
CarouselView
的优点:
- 现在可以嵌入页面(大福利)
- 已虚拟化
建议1:
如果你想在你的项目中使用CarouselPage
,你需要自己编写:
建议2:
使用CarouselView
代替:
关于xamarin - 轮播页面未出现在 Xamarin.Forms 模板中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53366183/