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

Alysson Amaral 156 Reputation points
2021-05-17T15:09:30.21+00:00

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

<AbsoluteLayout.LayoutBounds>
    <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>
     </OnPlatform>
</AbsoluteLayout.LayoutBounds>

What can I do to fix it?

Xamarin
Xamarin
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
    2021-05-18T05:28:10.673+00:00

    Hello,​

    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.

    97287-image.png

    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