gpt4 book ai didi

xamarin - 如何在Xamarin表单中使用单选按钮

转载 作者:行者123 更新时间:2023-12-04 05:06:04 25 4
gpt4 key购买 nike

创建注册页面后,我需要从用户那里获取以下数据。

  • 姓氏
  • 用户名
  • 电子邮件
  • 密码
  • 出生日期
  • 性别
  • 用户角色

  • 对于最后两个参数,我无法在Xamarin.Forms中找到如何使用单选按钮。以下是我的注册页面代码。
    <StackLayout BackgroundColor="#30af91" Padding="60">


    <Entry Text="{Binding FirstName}" Placeholder="First Name"/>
    <Entry Text="{Binding LastName}" Placeholder="Last Name"/>
    <Entry Text="{Binding UserName}" Placeholder="Last Name"/>
    <Entry Text="{Binding Email}" Placeholder="Email" />
    <Entry Text="{Binding Password}" Placeholder="Password" IsPassword="True"/>
    <Entry Text="{Binding ConfirmPassword}" Placeholder="Confirm Password" IsPassword="True"/>
    <DatePicker MinimumDate="1/1/1948" MaximumDate="12/31/2007"/>


    <!--Radio buttons for Gender
    1. Male 2.Female-->

    <!--Radio Buttons for UserRole
    1. Admin 2.Participant-->

    <Button Command="{Binding RegisterCommand}" Text="Register"/>
    <Label Text="{Binding Message}" />


    </StackLayout>

    最佳答案

    Xamarin表单不提供单选按钮。
    您可以使用
    1)Switch
    2)Picker
    或任何其他满足您要求的组件
    更新
    xamarin表单更新版本4.6引入了单选按钮控件,这是官方的documentation

    关于xamarin - 如何在Xamarin表单中使用单选按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44143634/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com