示例#1
0
        //this comment should only be available in dev
        //this comment should only be available in release branch
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            var surfaceOrientation = WindowManager.DefaultDisplay.Rotation;

            mainLayout = viewResource.LinLayout (this);
            if(surfaceOrientation == SurfaceOrientation.Rotation0 || surfaceOrientation == SurfaceOrientation.Rotation180)
            {
                mainLayout.Orientation = Orientation.Vertical;
            }
            else if (surfaceOrientation == SurfaceOrientation.Rotation90 || surfaceOrientation == SurfaceOrientation.Rotation270)
            {
                mainLayout.Orientation = Orientation.Horizontal;
            }

            topLayout = viewResource.LinLayout (this);
            topLayout.Id = 1;
            topLayout.WeightSum = 1;
            //topLayout.SetMinimumHeight(mainLayout.Height * .25);

            bottomLayout = viewResource.LinLayout (this);
            bottomLayout.Id = 2;
            bottomLayout.WeightSum = 1;
            //bottomLayout.SetMinimumHeight( mainLayout.Height * .75);

            LoadFragments ();

            mainLayout.AddView (topLayout);
            mainLayout.AddView (bottomLayout);

            SetContentView (mainLayout);

            Console.WriteLine(mainLayout.ToString ());
        }