2016-12-02 72 views
0

我的工作在Visual Studio 2015使用Xamarin一个跨平台的应用程序正常工作。我正在使用XLabs.Forms v2.3.0- pre 05,我遇到了radio buttonscheckboxes的问题。单选按钮和复选框不是在iOS和UWP

现在checkboxesUWP上正常工作,但它们不会显示在iOS上。而在iOS只有文本被显示在下方

看图片

单选按钮,在UWP不会在所有的工作。

这是我的复选框代码:

<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> 

这是我的单选按钮代码:

<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" 
     }; 

我试图跟随其他可能的解决方法,但没有为我工作。

UWP iOS

回答

0

Xamarin.Forms没有定义任何复选框控件或单选按钮。你可以使用一个应该做你想要的开关。或使用库如this