【问题标题】:Gradient as a Buttons BorderColor Xamarin Android?渐变作为按钮边框颜色 Xamarin Android?
【发布时间】:2019-12-31 18:11:44
【问题描述】:

我正在尝试在 Xamarin 表单中创建一个带有渐变边框颜色的按钮,我在下面找到了 IOS 的解决方案,但我找不到任何适用于 android 的东西,有人可以帮助我吗?

Gradient as a Buttons BorderColor?

【问题讨论】:

    标签: c# xamarin xamarin.forms custom-renderer


    【解决方案1】:

    您可以使用提供渐变边框的PancakeView,并添加触摸手势识别器:

    <yummy:PancakeView 
        BackgroundColor="#e2e885" 
        BorderGradientStops="{StaticResource Rainbow}" 
        HeightRequest="150" 
        CornerRadius="40,10,40,10" 
        BorderThickness="4" 
        BorderColor="#456287">
        <yummy:PancakeView.GestureRecognizers>
            <TapGestureRecognizer Command="{Binding OnTapCommand}" NumberOfTapsRequired="1" />
        </yummy:PancakeView.GestureRecognizers>
        <Label Text="Button text" HorizontalOptions="Center" VerticalOptions="Center" />
    </yummy:PancakeView>
    

    【讨论】:

      猜你喜欢
      • 2018-12-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-24
      • 2020-12-12
      • 1970-01-01
      • 2018-10-08
      • 2013-04-27
      相关资源
      最近更新 更多