简体   繁体   English

轮播视图还是自定义渲染选项卡?

[英]Carousel view or Custom Render Tabs?

I have question - what is rightn and correct way to implement this design in Xamarin (Xamarin forms) Design principle 我有一个问题-在Xamarin(Xamarin表单) 设计原则中实现该设计的正确和正确方法是什么?

I see here 2 ways for implementations: 我在这里看到两种实现方式:

First way - is TabbedPage . 第一种方法-是TabbedPage And right Custom Render (For IOS - move tabs to top, and for android - Icons) 右侧的Custom Render (对于IOS-将标签移至顶部,对于android-图标)

Second way - is CarouselView - but not sure is good. 第二种方式-是CarouselView但不确定是否很好。

Additional requirements is - Animation switch between content of "tabs" Switch by finger slide is NICE TO HAVE option. 附加要求是-在“选项卡”内容之间进行动画切换通过手指滑动切换是NICE TO HAVE选项。

There is no right and wrong way. 没有对与错的方法。 There is only what meets your requirements and what is easiest to implement and maintain. 只有满足您要求的内容,最容易实现和维护的内容。

Your linked picture clearly shows a TabbedPage. 链接的图片清楚地显示了TabbedPage。 However your additional requirements would make this an issue. 但是,您的其他要求将使此成为问题。 iOS shows the tabs at the bottom. iOS在底部显示选项卡。 I'm not sure if it is easy to move them to the top. 我不确定将它们移到顶部是否容易。 It would require a custom renderer if it is even possible. 如果可能,将需要自定义渲染器。 I think iOS allows you to swipe between tabbed pages but I'm not sure that Android does. 我认为iOS允许您在选项卡式页面之间滑动,但是我不确定Android是否可以。

It would probably be easier to implement a CarouselView with buttons above. 使用上面的按钮实现CarouselView可能会更容易。 That way you will be able to place your buttons where you like, allow you to swipe between them and have animation. 这样,您就可以将按钮放置在所需的位置,在它们之间滑动并制作动画。 This meets all your requirements. 这符合您的所有要求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM