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

RelativeLayout.XConstraint & RelativeLayout.YConstraint XAML to C#

$
0
0

Good day,

I'm looking for a way to convert the following XAML code into C# code, :

<ActivityIndicator x:Name="activityIndicator"
                                   IsRunning="true"
                                   HorizontalOptions="CenterAndExpand"
                                   RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.5}"
                                   RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.5}" 
                                   />

I need to do this, because I when I use the above XAML code, the ActivityIndicator will appear slightly off to the right and down. So I would need to subtract it with AcitivityIndicator.Width / 2.

A solution as to do this in XAML is also appreciated.

Thanks!

Sincerely,
Niels


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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