【问题标题】:Gradient color segmented control in xamarin formsxamarin 形式的渐变颜色分段控制
【发布时间】:2019-03-16 13:34:33
【问题描述】:

我需要你的帮助。

我想在 xamarin 表单中做渐变背景颜色分段控件,就像这个屏幕截图一样。 我怎样才能做到这一点? 任何想法? 谢谢。

替代链接:Alternative link

【问题讨论】:

    标签: xamarin.forms segmentedcontrol


    【解决方案1】:

    您可以使用 PancakeView: https://github.com/sthewissen/Xamarin.Forms.PancakeView

    此视图支持圆角、阴影和渐变(带有开始和结束颜色,加上渐变角度)。

    您可以使用PancakeView 作为背景(带有白色背景、圆角和阴影),并在StackLayout(或Grid)内部使用两个Label“现有用户”和“新用户”。 每个Label 都带有一个GestureRecognizer,因此当被点击时,您可以在背景中的Label 和PancakeView 之间显示另一个带有渐变背景的PancakeView

    您必须将所有内容嵌入Grid,这样您就可以在每个人的顶部显示图层。微观管理可能很棘手,但无需太多努力即可实现。

    【讨论】:

    • 谢谢。这将非常有帮助
    • @muhammetsahin 我很乐意为您提供帮助 :) 如果这解决了您的问题,请不要忘记标记答案 :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-02
    • 1970-01-01
    • 2018-01-13
    相关资源
    最近更新 更多