I have a problem and was wondering if anyone here could help!
I'm working on an app and I want the UI to change depending on screen size. For example:
if (heightInPixels == 1000)
{
ProgressBar.LayoutParameters.Width = 292;
ProgressBar.LayoutParameters.Height = 292;
}
This works fine and changes the progress bar dimensions. However, I can't seem to find a way to change an EXISTINGmarginBottom
property. This property is inside a RelativeLayout
and I can only find solutions for LinearLayout
.
I have a RelativeLayout
called RelativeLayoutHeader
and I've tried several things that I read here so far, like:
RelativeLayoutHeader.Bottom = 15 //don't know what happens, nothing apparently
RelativeLayoutHeader.layoutParams.addRule(...) //layoutParams does not contain a def for...)
FrameLayout.LayoutParams imgViewParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WrapContent, FrameLayout.LayoutParams.WrapContent, 0.0f);
imgViewParams.SetMargins(10, 10, 10, 10); //does not work because i have a coordinatorLayout.
I'm new to Xamarin, sorry if I didn't explain my problem correctly. Thanks in advance and have a nice day.