Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Relative Layout iOS render View at bottom of screen (Xaml)

$
0
0

Hi,

I am having trouble rendering a button on iOS with the following code

<ContentPage.Content>
<RelativeLayout>

    <Button x:Name="Button_RequestHelp"
        Text="Requisitar Ajuda"
        TextColor="{x:Static local:ThemeConstants.LabelTextLight}"
        BackgroundColor="{x:Static local:ThemeConstants.ButtonDarkGrayBackground}"
        RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=10}"
        RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Height,Constant=-40}" 
        RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,Property=Width,Constant=-20}">

    </Button>
    </RelativeLayout>
</ContentPage.Content>

On Android does exactly what I pretend, on iOS the first time I load the page it renders the button off screen, then if I start another page and come back the button is rendered properly at the bottom...

So my guess is that the first time it loads the page height is bigger than the actual screen height, but then it corrects itself.
What could be causing this?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>