public GemsMainPage() { NavigationPage.SetHasNavigationBar(this, false); masterLayout = new CustomLayout(); masterLayout.BackgroundColor = Color.FromRgb(244, 244, 244); progressBar = DependencyService.Get<IProgressBar>(); progressBar.ShowProgressbar ("Loading gems.."); App.isEmotionsListing = false; isLoadingFromDetailsPage = false; this.Appearing += OnAppearing; this.Disappearing += GemsMainPage_Disappearing; mainTitleBar = new GemsPageTitleBar(Color.FromRgb(8, 135, 224), "Goal Enabling Materials", Color.White, "", true); mainTitleBar.imageAreaTapGestureRecognizer.Tapped += OnImageAreaTapGestureRecognizerTapped; masterScroll = new ScrollView(); masterScroll.WidthRequest = App.screenWidth; masterScroll.HeightRequest = App.screenHeight * 85 / 100; masterScroll.BackgroundColor = Color.White; masterScroll.Scrolled += OnScroll; masterScroll.IsClippedToBounds = true; masterStack = new StackLayout(); masterStack.Orientation = StackOrientation.Vertical; masterStack.BackgroundColor = Color.White; emotionLabel = new Label { Text = "EMOTIONS ", FontFamily = Constants.HELVERTICA_NEUE_LT_STD, FontSize = Device.OnPlatform (14, 18, 14), HorizontalOptions = LayoutOptions.End, VerticalOptions = LayoutOptions.Center, TextColor = Color.White, WidthRequest = App.screenWidth * .5, XAlign = TextAlignment.Center }; emotionsButtion = new StackLayout{ Children = { emotionLabel }, BackgroundColor = Color.FromRgb(8, 159, 245), Orientation = StackOrientation.Horizontal, WidthRequest = App.screenWidth * .5 ///HorizontalOptions = LayoutOptions.Center }; emotionListingBtnTapgesture = new TapGestureRecognizer (); emotionListingBtnTapgesture.Tapped += ShowEmotionsTapGesture_Tapped; emotionsButtion.GestureRecognizers.Add (emotionListingBtnTapgesture); goalsAndDreamsLabel = new Label { Text = "GOALS & DREAMS", FontFamily = Constants.HELVERTICA_NEUE_LT_STD, FontSize = Device.OnPlatform (14, 18, 14), HorizontalOptions = LayoutOptions.End, VerticalOptions = LayoutOptions.Center, TextColor = Color.Gray, XAlign = TextAlignment.Center }; goalsButton = new StackLayout{ Children = { goalsAndDreamsLabel }, BackgroundColor = Constants.INPUT_GRAY_LINE_COLOR, Orientation = StackOrientation.Horizontal, WidthRequest = App.screenWidth * .5, HorizontalOptions = LayoutOptions.Center, Padding = new Thickness(Device.OnPlatform(20,15,20),0,0,0) }; goalsListingBtnTapgesture = new TapGestureRecognizer (); goalsListingBtnTapgesture.Tapped += GoalsListingBtnTapgesture_Tapped; goalsButton.GestureRecognizers.Add (goalsListingBtnTapgesture); masterLayout.AddChildToLayout(mainTitleBar, 0, 0); masterLayout.AddChildToLayout(new StackLayout{HeightRequest = App.screenHeight * 0.08, Orientation = StackOrientation.Horizontal, Spacing = 0, Children = {emotionsButtion, goalsButton}}, 0,Device.OnPlatform(9,10,10)); progressBar.HideProgressbar (); }