0

I am working on a cross platform app using Xamarin in Visual Studio 2015. I am using XLabs.Forms v2.3.0- pre 05 and I am having problems with radio buttons and checkboxes.

Right now the checkboxes work fine on UWP but they won't show on iOS.

The radio buttons, on UWP won't work at all while on iOS only the texts gets displayed

See pictures below.

This is my code for checkboxes:

<ListView x:Name="lv_ReportQuestions">
          <ListView.ItemTemplate>
            <DataTemplate>
              <ViewCell>
                <StackLayout 
                  Orientation="Vertical"
                >
                  <StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand">

                    <StackLayout WidthRequest="{Binding DisplayWidth}">
                      <Label HorizontalOptions="FillAndExpand" Text="{Binding ItemName}" VerticalOptions="Center" LineBreakMode="WordWrap"/>
                    </StackLayout>

                    <controls:CheckBox DefaultText="" WidthRequest="40" IsEnabled="false" IsVisible="true" Checked="true" HorizontalOptions="EndAndExpand"/>

                  </StackLayout>
                  <Label HorizontalOptions="FillAndExpand" Text="{Binding SubText}" VerticalOptions="Center"/>
                </StackLayout>
            </ViewCell>
          </DataTemplate>
        </ListView.ItemTemplate>
</ListView>

This is my code for radio buttons:

<Label Text="Radio Buttons"/>

    <Frame
        HorizontalOptions="FillAndExpand"
        VerticalOptions="CenterAndExpand"
        OutlineColor="#000000"
      >
      <controls:BindableRadioGroup x:Name="ansPicker"
                                   IsVisible="true"/>
    </Frame>

ansPicker.ItemsSource = new[]
        {
            "Red",
            "Blue",
            "Green",
            "Yellow",
            "Orange"
        };

I have tried to follow other possible fixes, but nothing worked for me.

UWP iOS

Aurora
  • 23
  • 9

1 Answers1

0

Xamarin.Forms does not define any CheckBox control or radio button. You can use a Switch that should do what you expect. or use library such as this

Danil Kurkin
  • 283
  • 2
  • 11