添加了Xamarin.Forms条目文本,但未显示
启动应用程序时,我正在制作Pin验证程序。这是我的代码:添加了Xamarin.Forms条目文本,但未显示,xamarin.forms,xamarin.android,xamarin.ios,Xamarin.forms,Xamarin.android,Xamarin.ios,启动应用程序时,我正在制作Pin验证程序。这是我的代码: <ContentPage.Content> <StackLayout Spacing="10" VerticalOptions="Center" Margin="10,0,10,0" > <Grid x:Name="LayoutRoot"> <Grid.RowDefinitions>
<ContentPage.Content>
<StackLayout Spacing="10" VerticalOptions="Center" Margin="10,0,10,0" >
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="1.3*" />
<RowDefinition Height="*" />
<RowDefinition Height="0.5*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowSpacing>
<OnPlatform x:TypeArguments="x:Double" Android="20" iOS="20" />
</Grid.RowSpacing>
<Grid.ColumnSpacing>
<OnPlatform x:TypeArguments="x:Double" Android="20" iOS="20" />
</Grid.ColumnSpacing>
<Frame BorderColor="#006BE6" BackgroundColor="WhiteSmoke" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" >
<Entry TextColor="#006BE6" FontSize="48" IsPassword="True" x:Name="Output" Text="{Binding Pin}" HorizontalOptions="Center" VerticalOptions="Center" IsReadOnly="True">
<Entry.Behaviors>
<behaviors:EntryLengthValidatorBehavior MaxLength="4" />
</Entry.Behaviors>
</Entry>
</Frame>
<Button TextColor="#006BE6" Text="1" Grid.Row="3" Grid.Column="1" Command="{Binding LoadNumberCommand}" CommandParameter="1" BorderColor="#006BE6" BorderWidth="1" BackgroundColor="WhiteSmoke" />
<Button TextColor="#006BE6" Text="2" Grid.Row="3" Grid.Column="2" Command="{Binding LoadNumberCommand}" CommandParameter="2" BorderColor="#006BE6" BorderWidth="1" BackgroundColor="WhiteSmoke"/>
<Button TextColor="#006BE6" Text="3" Grid.Row="3" Grid.Column="3" Command="{Binding LoadNumberCommand}" CommandParameter="3" BorderColor="#006BE6" BorderWidth="1" BackgroundColor="WhiteSmoke"/>
<Button TextColor="#006BE6" Text="4" Grid.Row="4" Grid.Column="1" Command="{Binding LoadNumberCommand}" CommandParameter="4" BorderColor="#006BE6" BorderWidth="1" BackgroundColor="WhiteSmoke"/>
<Button TextColor="#006BE6" Text="5" Grid.Row="4" Grid.Column="2" Command="{Binding LoadNumberCommand}" CommandParameter="5" BorderColor="#006BE6" BorderWidth="1" BackgroundColor="WhiteSmoke"/>
<Button TextColor="#006BE6" Text="6" Grid.Row="4" Grid.Column="3" Command="{Binding LoadNumberCommand}" CommandParameter="6" BorderColor="#006BE6" BorderWidth="1" BackgroundColor="WhiteSmoke"/>
<Button TextColor="#006BE6" Text="7" Grid.Row="5" Grid.Column="1" Command="{Binding LoadNumberCommand}" CommandParameter="7" BorderColor="#006BE6" BorderWidth="1" BackgroundColor="WhiteSmoke"/>
<Button TextColor="#006BE6" Text="8" Grid.Row="5" Grid.Column="2" Command="{Binding LoadNumberCommand}" CommandParameter="8" BorderColor="#006BE6" BorderWidth="1" BackgroundColor="WhiteSmoke"/>
<Button TextColor="#006BE6" Text="9" Grid.Row="5" Grid.Column="3" Command="{Binding LoadNumberCommand}" CommandParameter="9" BorderColor="#006BE6" BorderWidth="1" BackgroundColor="WhiteSmoke"/>
<Button TextColor="#006BE6" Text="C" Grid.Row="6" Grid.Column="1" Command="{Binding LoadNumberCommand}" CommandParameter="C" BorderColor="#006BE6" BorderWidth="1" BackgroundColor="WhiteSmoke"/>
<Button TextColor="#006BE6" Text="0" Grid.Row="6" Grid.Column="2" Command="{Binding LoadNumberCommand}" CommandParameter="0" BorderColor="#006BE6" BorderWidth="1" BackgroundColor="WhiteSmoke"/>
<Button TextColor="#006BE6" Text="OK" Grid.Row="6" Grid.Column="3" Command="{Binding LoadNumberCommand}" CommandParameter="OK" BorderColor="#006BE6" BorderWidth="1" BackgroundColor="WhiteSmoke"/>
</Grid>
</StackLayout>
</ContentPage.Content>
指挥部呢
LoadNumberCommand = new Command(execute: async (value) => await ExecutePinElement(value));
将条目的IsReadOnlyproperty设置为false
或
将水平选项更改为FillAndExpand并添加HorizontalTextAlignment=Center您能更具体一点吗?是未显示的文本还是条目本身?绑定Pin正在工作。在Pin中,我得到了我添加的数字,但数字或密码****没有显示我将用截图编辑的文本。你能显示EntryLengthValidatorBehavioryour吗?在输入框FillandExp中添加grid.row=1和grid.Column=1 grid.ColumnSpan=3并解决了我的问题,我是居中的,没有显示所有文本,谢谢你乐于帮助=
LoadNumberCommand = new Command(execute: async (value) => await ExecutePinElement(value));