public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var acticity = container.Context as MultiPropertyDialogActivity; var dp2 = DroidUtils.DpToPixels(2); var dp10 = DroidUtils.DpToPixels(10); var dp36 = DroidUtils.DpToPixels(36); var linearLayoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); linearLayoutParams.SetMargins(dp2, dp2, dp2, dp2); var linearLayout = new LinearLayout(container.Context); linearLayout.Orientation = Orientation.Vertical; linearLayout.LayoutParameters = linearLayoutParams; linearLayout.SetBackgroundColor(DroidUtils.GetColorFromResources(container.Context, Resource.Color.DarkGreyFillColor1)); var first = true; for (int i = 0; i < dialog.PageCount; i++) { var tab = dialog.GetPropertyPageTab(i); if (!tab.visible) { continue; } if (!first) { var spacer = new View(container.Context); spacer.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 1); spacer.SetBackgroundColor(DroidUtils.GetColorFromResources(container.Context, Resource.Color.LightGreyFillColor1)); linearLayout.AddView(spacer); } first = false; var imageView = new ImageView(container.Context); imageView.LayoutParameters = new LinearLayout.LayoutParams(dp36, dp36); imageView.SetImageBitmap(PlatformUtils.LoadBitmapFromResource($"FamiStudio.Resources.{tab.image}@2x.png", true)); var textViewLayoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); textViewLayoutParams.Gravity = GravityFlags.Left | GravityFlags.CenterVertical; var textView = new TextView(new ContextThemeWrapper(container.Context, Resource.Style.LightGrayTextMedium)); textView.Text = tab.text; textView.LayoutParameters = textViewLayoutParams; textView.SetPadding(dp10, 0, 0, 0); var buttonLayoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); buttonLayoutParams.SetMargins(dp10, dp10, dp10, dp10); var buttonLayout = new LinearLayout(container.Context); buttonLayout.LayoutParameters = buttonLayoutParams; buttonLayout.AddView(imageView); buttonLayout.AddView(textView); buttonLayout.SetOnClickListener(acticity); linearLayout.AddView(buttonLayout); tab.button = buttonLayout; } return(linearLayout); }