public MyPage() { AbsoluteLayout absoluteLayout = new AbsoluteLayout(); mycollectionview = new mycollectionview(); _bottomSheetFrame = new Frame { HasShadow = true, CornerRadius = 20 }; BoxView box = new BoxView { Margin = 5, HeightRequest = 4, CornerRadius = 5, WidthRequest = 70, BackgroundColor = Color.Gray, HorizontalOptions = LayoutOptions.Center }; var panGesture = new PanGestureRecognizer(); panGesture.PanUpdated += OnPanUpdated; _bottomSheetFrame.GestureRecognizers.Add(panGesture); mycollectionview.stackLayout.Padding = 10; _bottomSheetStackLayout = new StackLayout { Children = { box, mycollectionview.stackLayout } }; _bottomSheetFrame.Content = _bottomSheetStackLayout; absoluteLayout.Children.Add(_bottomSheetFrame); _bottomSheetFrame.TranslateTo(_bottomSheetFrame.X, 300, 20); y = 300; //mycollectionview.collectionView.HeightRequest = App.ScreenHeight-250; BindingContext = new MainPageItem(); Content = absoluteLayout; }
public PanContainer() { BackgroundColor = Color.FromHex("#50D3D3D3"); var panGesture = new PanGestureRecognizer(); panGesture.PanUpdated += OnPanUpdated; GestureRecognizers.Add(panGesture); statusBarHeight = DependencyService.Get <IStatusBar>().GetHeight(); pageHeight = App.ScreenHeight - statusBarHeight; _myCollectionview = new mycollectionview(); _box = new BoxView { Margin = 2, HeightRequest = 3, CornerRadius = 3, WidthRequest = 50, BackgroundColor = Color.FromHex("#D3D3D3"), HorizontalOptions = LayoutOptions.Center }; _bottomSheetFrame = new Frame { CornerRadius = 20, Content = new StackLayout { Children = { _box, _myCollectionview.stackLayout , new StackLayout { HeightRequest = 100 } } } }; y = pageHeight / 9; _bottomSheetFrame.TranslationY = y; _myCollectionview.collectionView.HeightRequest = pageHeight - 300; Content = _bottomSheetFrame; }