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

Center item in RelativeLayout

$
0
0

Hi guys,

I have faced with another issue ...
It is difficult to find how to center image or another item inside RelativeLayout ?!

I have found something like this solution:

<ffimageloadingsvg:SvgCachedImage
                    RelativeLayout.WidthConstraint="{ConstraintExpression 
                        Type=RelativeToParent,
                        Property=Width,
                        Factor=0.5,
                        Constant=0}"
                    RelativeLayout.HeightConstraint="{ConstraintExpression 
                        Type=RelativeToParent,
                        Property=Height,
                        Factor=0.5,
                        Constant=0}"
                    RelativeLayout.XConstraint="{ConstraintExpression 
                        Type=RelativeToParent,
                        Property=Width,
                        Factor=0.25,
                        Constant=0}"
                    RelativeLayout.YConstraint="{ConstraintExpression 
                        Type=RelativeToParent,
                        Property=Height,
                        Factor=0.25,
                        Constant=0}"
                    WidthRequest="50"
                    HeightRequest="50"
                    Source="resource://image.svg"/>

Is there better solution ?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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