private void SpinButtonLayout()
        {
            /***********************
            **SpinButtonAlignment**
            ***********************/
            LinearLayout.LayoutParams spinButtonLayoutParams = new LinearLayout.LayoutParams(width * 2, 5);
            spinButtonLayoutParams.SetMargins(0, 20, 0, 0);

            //SpinButtonText
            TextView spinButtonText = new TextView(context);

            spinButtonText.TextSize = 20;
            spinButtonText.Text     = "SpinButtonAlignment";

            //SpinButtonList
            List <String> spinButtonList = new List <String>();

            spinButtonList.Add("Right");
            spinButtonList.Add("Left");
            spinButtonList.Add("Both");
            spinButtonDataAdapter = new ArrayAdapter <String>
                                        (context, Android.Resource.Layout.SimpleSpinnerItem, spinButtonList);
            spinButtonDataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);

            //SpinButtonSpinner
            spinButtonSpinner         = new Spinner(context, SpinnerMode.Dialog);
            spinButtonSpinner.Adapter = spinButtonDataAdapter;

            TextView textSpacing = new TextView(context);

            propertylayout.AddView(textSpacing);
            //SpinButtonSpinner ItemSelected Listener
            spinButtonSpinner.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => {
                String selectedItem = spinButtonDataAdapter.GetItem(e.Position);
                if (selectedItem.Equals("Right"))
                {
                    spinButtonAlignment = SpinButtonAlignment.Right;
                    textAlign           = Android.Views.TextAlignment.TextStart;
                    gravity             = GravityFlags.CenterVertical;
                }
                if (selectedItem.Equals("Left"))
                {
                    spinButtonAlignment = SpinButtonAlignment.Left;
                    textAlign           = Android.Views.TextAlignment.TextEnd;
                    gravity             = GravityFlags.End | GravityFlags.CenterVertical;
                }
                if (selectedItem.Equals("Both"))
                {
                    spinButtonAlignment = SpinButtonAlignment.Both;
                    textAlign           = Android.Views.TextAlignment.Center;
                    gravity             = GravityFlags.Center;
                }
            };
            propertylayout.AddView(spinButtonText);
            propertylayout.AddView(spinButtonSpinner);

            //SpinButtonSeparate
            SeparatorView spinButtonSeparate = new SeparatorView(context, width * 2);

            spinButtonSeparate.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
            // propertylayout.AddView(spinButtonSeparate, spinButtonLayoutParams);
        }
        private void SpinButtonAlignmentLayout()
        {
            //spinButtonAlignment
            TextView spinButtonText = new TextView(context);

            spinButtonText.LayoutParameters = new FrameLayout.LayoutParams((int)(totalWidth * 0.33), ViewGroup.LayoutParams.WrapContent, GravityFlags.Center);
            spinButtonText.TextSize         = 15;
            spinButtonText.Text             = "SpinButtonAlignment";

            //spinButtonList
            List <String> spinButtonList = new List <String>();

            spinButtonList.Add("Right");
            spinButtonList.Add("Left");
            spinButtonList.Add("Both");
            spinButtonDataAdapter = new ArrayAdapter <String>
                                        (context, Android.Resource.Layout.SimpleSpinnerItem, spinButtonList);
            spinButtonDataAdapter.SetDropDownViewResource
                (Android.Resource.Layout.SimpleSpinnerDropDownItem);
            //spinButtonSpinner
            spinButtonSpinner = new Spinner(context, SpinnerMode.Dialog);
            spinButtonSpinner.LayoutParameters = new FrameLayout.LayoutParams((int)(totalWidth * 0.33), ViewGroup.LayoutParams.WrapContent, GravityFlags.Center);
            spinButtonSpinner.Adapter          = spinButtonDataAdapter;
            spinButtonSpinner.SetSelection(spinButtonPosition);
            spinButtonSpinner.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => {
                String selectedItem = spinButtonDataAdapter.GetItem(e.Position);
                spinButtonPosition = e.Position;
                if (selectedItem.Equals("Right"))
                {
                    spinButtonAlignment = SpinButtonAlignment.Right;
                    textAlign           = Android.Views.TextAlignment.TextStart;
                    gravity             = GravityFlags.CenterVertical;
                }
                if (selectedItem.Equals("Left"))
                {
                    spinButtonAlignment = SpinButtonAlignment.Left;
                    textAlign           = Android.Views.TextAlignment.TextEnd;
                    gravity             = GravityFlags.End | GravityFlags.CenterVertical;
                }
                if (selectedItem.Equals("Both"))
                {
                    spinButtonAlignment = SpinButtonAlignment.Both;
                    textAlign           = Android.Views.TextAlignment.Center;
                    gravity             = GravityFlags.Center;
                }
                ApplyChanges();
            };

            //spinButtonLayout
            LinearLayout spinButtonLayout = new LinearLayout(context);

            spinButtonLayout.Orientation = Android.Widget.Orientation.Horizontal;
            spinButtonLayout.AddView(spinButtonText);
            spinButtonLayout.AddView(spinButtonSpinner);
            proprtyOptionsLayout.AddView(spinButtonLayout);

            //spaceText
            TextView spaceText4 = new TextView(context);

            spaceText4.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 40, GravityFlags.Center);
            proprtyOptionsLayout.AddView(spaceText4);
        }