TabbedPage Xamarin中的ReturnType条目

时间:2018-07-24 13:39:31

标签: xamarin

我有这样的布局:

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            x:Class="EstanciaMobileApp.Views.InventarioTabView"
            xmlns:key="clr-namespace:EstanciaMobileApp.Custom">
    <TabbedPage.Children>
        <ContentPage Title="Inventário" >
            <StackLayout HorizontalOptions="FillAndExpand"
                         VerticalOptions="StartAndExpand"
                         Margin="20">
                <StackLayout>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="2*"></ColumnDefinition>
                            <ColumnDefinition Width="1*"></ColumnDefinition>
                            <ColumnDefinition Width="2*"></ColumnDefinition>
                            <ColumnDefinition Width="1*"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Label Text="Número" Grid.Column="0"/>
                        <key:CustomKeyEntry 
                            x:Name="txtLocNumero"
                            ReturnType="Next"
                            HorizontalOptions="FillAndExpand" 
                            Text="{Binding LocalizacaoFisicaAba.Numero}" 
                            Placeholder="Número" 
                            Keyboard="Numeric" Grid.Column="1"/>

                        <Label Text="Sequencia" Grid.Column="2"/>
                        <key:CustomKeyEntry 
                            x:Name="txtLocSeq"
                            ReturnType="Next"
                            HorizontalOptions="FillAndExpand" 
                            Text="{Binding LocalizacaoFisicaAba.Sequencia}" 
                            Placeholder="Sequencia" 
                            Keyboard="Numeric" 
                            Grid.Column="3"/>
                    </Grid>
                </StackLayout>
            </StackLayout>
        </ContentPage>
    </TabbedPage.Children>
</TabbedPage>

我要这样做:

txtLocNumero.Completed += (object sender, EventArgs e) => { txtLocSeq.Focus(); };

我想将焦点移到另一个组件,但无法在后面的代码中访问这些组件。

但是它不起作用,请查看错误: Error

1 个答案:

答案 0 :(得分:0)

对不起,人们正常工作是Visual Studio的一个错误,请重新构建解决方案然后再工作。

谢谢大家!