this question is simple, but i’m not finding nothing about it. How can i set margin into a widget in code-behind.
I found this document into Xamarin’s site, but i can’t use this into a ImageView
I also tried the method Layout() in my ImageView, but it didn’t work.
ImageView imgView = FindViewById<ImageView>(Resource.Id.imageView);
imgView.Layout(10, 10, 10, 10);
Have you tried using FrameLayout’s LayoutParams?
Here is an example:
Your image:
Your image’s parameters:
Setting your image’s parameters:
EDIT: Changed LinearLayout.LayoutParameters to FrameLayout.LayoutParameters!