Reputation: 681
I am using a ContentView inside Xamarin form. There I have height constraint define for that content view.
<gComments:GCommentEntryView x:Name="gCommentEntryView"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1, Constant=100}"
Is there a way that I can change dynamically this value of height constraint via code behind?
Upvotes: 1
Views: 742
Reputation: 340
You can use it
Device.BeginInvokeOnMainThread(() =>
{
RelativeLayout.SetHeightConstraint(gCommentEntryView, Constraint.RelativeToParent(layout => 100));
});
Upvotes: 1