Entry view - can you make its size specific to a platform?

VS 2015, PCL. My page has a few Entries, where numeric data is entered and restricted to a certain number of digits. On Android and IOS (mobile), the underlines show for these fields. On Windows (Desktop), the fields are outlined by boxes. If I give a widthrequest long enough to complete the outline box (on Windows), the other two platforms show underlines longer than required (and can affect whether or not there is enough room for the Entry size). If I do not give a widthrequest, the windows entry outline boxes are cut off (while other are not), and overall, the form looks unprofessional.

I am doing the layout in XAML. Can I affect the XAML code to be specific (for a particular Entry field), for the type of platform?

Posts

  • louwholouwho USMember ✭✭✭

    Ok, got that done...
    <Entry.WidthRequest>

    </Entry.WidthRequest>

    I have one more OnPlatform question. On the phones (because of their narrow width), everything lines up correctly. When I switch to the Windows desktop, the form width more than doubles, and things do not line up as well, and there is a lot of white space. How to correct this, contentpage does not seem to have any parameters that I can adjust. Here is the top of the XAML...


    <ContentPage.Content>


  • louwholouwho USMember ✭✭✭

    Code was cut from my last posting. Anything that started with "<". Reentering it here...

    OnPlatform x:TypeArguments="x:Double" iOS="100" Android="100" WinPhone="110"

    ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:SurveyAcres"
    x:Class="SurveyAcres.MainPage">
    ContentPage.Content>
    StackLayout x:Name= "mainStackLayout" Orientation="Vertical">
    StackLayout x:Name="topStackLayout" Orientation="Horizontal">
    StackLayout x:Name="leftChildStackLayout" Orientation="Vertical" WidthRequest="120" Spacing="4" BackgroundColor="Green"

Sign In or Register to comment.