Nativescript 单选按钮

Nativescript radiobutton

我正在开发 NativeScript 应用程序。我想在我的应用程序中使用单选按钮功能。

我试图通过使用 "nativescript-radiobutton" 插件来实现这一点,但它在 iOS 中不支持。

是否有任何解决方案可以同时适用于 Android 和 iOS 平台?

提前致谢。

将此 Html 用于单选按钮 -

<Label text="{{ checkYes ? '&#xf192;' : '&#xf10c;'}}" 
       class="{{ checkYes ? 'fontawesome' : 'radioBefore'}}" 
       (tap)="changeAction()">
</Label>

为 Font Awesome 应用这两个 类 -

.font-awesome {
   font-family: "fontawesome-webfont";
   font-size: 24;
}

.radioBefore {
   font-family: "fontawesome-webfont";
   font-size: 24;
}

在 fonts 文件夹中添加 Font-awesome.ttf 文件,然后将单选按钮 selectedunselected 更改为 changeAction()

函数 - 初始化 this.changeYes = true

 changeGenderMale(){
    if(this.changeYes == true)
      this.changeYes = false;
    else
      this.changeYes = true;
 }