protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
global::Xamarin.Forms.Forms.Init (this, bundle);
LoadApplication (new App ());
SetContentView(Resource.Layout.Main);
LinearLayout mainLayout = FindViewById<LinearLayout>(Resource.Id.MyLinearLayout);
var myLayout = new MyLayout(Android.App.Application.Context);
mainLayout.AddView (MyLayout);
}
public class MyLayout : RelativeLayout
{
protected override void OnSizeChanged(int w, int h, int oldw, int oldh)
{
// w = 800, h = 0
base.OnSizeChanged(w, h, oldw, oldh);
}
}
I want to add my layout on page and change size of my layout when it will be needed.
Width is determined correctly.
But height is always equals 0.