I was trying to set the margins of a view added in runtime, but without
success. Is this broken or am I missing something?

..
LinearLayout hostview....
TextView childView....
...
ViewGroup.MarginLayoutParams layoutParams = new
ViewGroup.MarginLayoutParams( ViewGroup.LayoutParams.FillParent,
ViewGroup.LayoutParams.WrapContent );

layoutParams.TopMargin = <some pixel value>
// also tried SetMargins method

hostView.AddView( childView, layoutParams );

..

This fails. If I add the child in the layout xml file and set the margins,
it works, though, I want to do this in runtime as these are dynamically
added items. Of course, I can use a xml file for template, but even so,
this should work right?

Cheers,


-- 
Gonçalo Oliveira
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to