AbsoluteLayout.LayoutBounds doens´t work after I updated to Xamarin.Forms 5.0

Alysson Amaral 156 Reputation points

After I updated to Xamarin.Forms 5.0 this line of code has been broken:

    <OnPlatform x:TypeArguments="Rectangle">
        <On Platform="Android">0.5,0.49,0.4,0.5</On>
        <On Platform="iOS">0.5,0.52,0.4,0.5</On>

What can I do to fix it?

A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,254 questions
0 comments No comments
{count} votes

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 64,001 Reputation points Microsoft Vendor


    Welcome to our Microsoft Q&A platform!

    I used following way to set LayoutBounds for Android and iOS, it is worked.

       <BoxView Color="Blue"  
                        AbsoluteLayout.LayoutBounds="{OnPlatform Android='0.5,0.49,0.4,0.5', iOS='0.5,0.52,0.4,0.5' }"  
                        AbsoluteLayout.LayoutFlags="All" />  

    Here is running screenshot.


    Best Regards,

    Leon Lu

    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

0 additional answers

Sort by: Most helpful