我是Xamarin 初学者,我在使用Xamarin 开发简单的APP时,页面上增加了一个Picker选择器,下面接着是一个Entry文本,在运行调试时发现先选择了Picker选择器内容后,再点Entry文本进去 修改值时一直重复要求选择Picker的值。
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:control="clr-namespace:TestApp.MyStyle"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:TestApp"
x:Class="TestApp.MainPage">
<StackLayout Margin="20">
<TableView Intent="Settings" >
<TableRoot>
<TableSection Title="远程I0控制">
<ViewCell >
<StackLayout Orientation="Horizontal" >
<Label Text="站号选择" VerticalOptions="Center" Margin="16,0,0,0"/>
<control:MyPickerRenderder Title="SlaveID" HorizontalOptions="EndAndExpand" TextColor="#f35e20" x:Name="SlaveList" SelectedIndexChanged="SlaveList_SelectedIndexChanged">
<control:MyPickerRenderder.Items>
</control:MyPickerRenderder.Items>
</control:MyPickerRenderder>
</StackLayout>
</ViewCell>
<ViewCell >
<StackLayout Orientation="Horizontal" >
<Label Text="起始地址" VerticalOptions="Center" Margin="16,0,0,0"/>
<control:MyEntryRender Keyboard="Numeric" Text="0" x:Name="StartAddress" Placeholder="输入起始地址" TextColor="#f35e20" HorizontalOptions="EndAndExpand" HorizontalTextAlignment="End" VerticalOptions="CenterAndExpand" />
</StackLayout>
</ViewCell>
<SwitchCell Text="开启或关闭" On="true" OnChanged="SwitchCellChanged" />
<ViewCell>
<StackLayout Orientation="Horizontal" >
<Label Text="回读状态" VerticalOptions="Center" Margin="16,0,0,0"/>
<Label Text="-" x:Name="status" HorizontalOptions="EndAndExpand" VerticalOptions="Center" TextColor="#f35e20"/>
</StackLayout>
</ViewCell>
</TableSection>
</TableRoot>
</TableView>
</StackLayout>
</ContentPage>
请问各位朋友,怎么解决?