Search code examples
xamarinxamarin.formsxamarin.forms-styles

How can I allocate more space to a numeric


Here is the XAML code that I created:

<ViewCell>
   <Grid VerticalOptions="CenterAndExpand" Padding="20, 0">
      <Label HorizontalOptions="StartAndExpand" Text="ABC" />
      <Entry Keyboard="Numeric" VerticalOptions="Center" HorizontalOptions="End" />
   </Grid>
</ViewCell>

When I run the code the data entry area for the window is only wide enough to show one digit. Is there a way I can expand this so it will allow me to enter three digits?


Solution

  • Set a WidthRequest value, and also try changing the HorizontalOptions

    <Entry Keyboard="Numeric" VerticalOptions="Center" WidthRequest="100" HorizontalOptions="FillAndExpand" />