private void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e) { CreateDetailsPopup(e.View); if ((50 * density) + e.View.Bottom + (130 * density) >= listView.Bottom) { detailsPopup.ShowRelativeToView(e.View, RelativePosition.AlignTop, 0, 0); } else { detailsPopup.ShowRelativeToView(e.View, RelativePosition.AlignBottom, 0, 0); } }
private void DisplayDetailsPopup() { detailsPopup = new SfPopupLayout(); detailsPopup.PopupView.BackgroundColor = UIColor.FromRGB(255, 255, 255); detailsPopup.PopupView.PopupStyle.BorderThickness = 5; detailsPopup.PopupView.ShowHeader = false; detailsPopup.PopupView.ShowFooter = false; detailsPopup.PopupView.Frame = new CGRect(-1, -1, this.Frame.Width - Label4.Frame.Width - 5, 150); detailsPopup.PopupView.ContentView = GetCustomPopupView(); if (((this.Frame.Bottom + detailsPopup.PopupView.Frame.Height) - (this.Superview as UITableView).ContentOffset.Y) + 10 <= this.Superview.Frame.Bottom) { detailsPopup.ShowRelativeToView(this, RelativePosition.AlignBottom, 10, 0); } else { detailsPopup.ShowRelativeToView(this, RelativePosition.AlignTop, 10, 0); } }
private void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e) { mainPopupLayout.PopupView.WidthRequest = (int)(e.View.Width / Resources.System.DisplayMetrics.Density); mainPopupLayout.PopupView.HeightRequest = 130; mainPopupLayout.PopupView.ShowHeader = false; mainPopupLayout.PopupView.PopupStyle.BorderColor = Color.White; mainPopupLayout.PopupView.PopupStyle.BorderThickness = 5; mainPopupLayout.PopupView.ShowFooter = false; mainPopupLayout.StaysOpen = false; mainPopupLayout.PopupView.PopupStyle.CornerRadius = 5; mainPopupLayout.PopupView.AnimationMode = AnimationMode.None; mainPopupLayout.PopupView.ContentView = GetCustomPopupView(this.context, e.View); if ((50 * density) + e.View.Bottom + (130 * density) >= listView.Bottom) { mainPopupLayout.ShowRelativeToView(e.View, RelativePosition.AlignTop); } else { mainPopupLayout.ShowRelativeToView(e.View, RelativePosition.AlignBottom); } }
private void DisplayDetailsPopup() { detailsPopup = new SfPopupLayout(); detailsPopup.PopupView.BackgroundColor = UIColor.FromRGB(255, 255, 255); detailsPopup.PopupView.PopupStyle.BorderThickness = 5; detailsPopup.PopupView.ShowHeader = false; detailsPopup.PopupView.ShowFooter = false; detailsPopup.PopupView.Frame = new CGRect(-1, -1, this.Frame.Width - Label4.Frame.Width - 5, 150); detailsPopup.PopupView.ContentView = GetCustomPopupView(); // In iPhone the parent is directly UITableView but in iPOD and iPAD the immedidate super view is not UITableView. Hence checked superview based on condition. if ((this.Frame.Bottom + detailsPopup.PopupView.Frame.Height) - (UIDevice.CurrentDevice.Model == "iPhone" ? (this.Superview as UITableView).ContentOffset.Y : (this.Superview.Superview as UITableView).ContentOffset.Y) + 10 <= this.Superview.Frame.Bottom) { detailsPopup.ShowRelativeToView(this, RelativePosition.AlignBottom, 10, 0); } else { detailsPopup.ShowRelativeToView(this, RelativePosition.AlignTop, 10, 0); } }
private void buttonTapped(object obj) { var listview = obj as SfListView; popupLayout = new SfPopupLayout(); popupLayout.PopupView.HeightRequest = 50; popupLayout.PopupView.WidthRequest = ItemWidth; popupLayout.PopupView.ContentTemplate = new DataTemplate(() => { var grid = new Grid(); grid.BackgroundColor = Color.Black; grid.Margin = 5; var label1 = new Label() { Text = "SnackView", TextColor = Color.White, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center }; var button = new Button() { Text = "Action", TextColor = Color.Violet, HorizontalOptions = LayoutOptions.EndAndExpand, VerticalOptions = LayoutOptions.Center, BackgroundColor = Color.Black, BorderRadius = 8 }; grid.Children.Add(label1, 0, 0); grid.Children.Add(button, 1, 0); return(grid); }); popupLayout.PopupView.ShowHeader = false; popupLayout.PopupView.ShowFooter = false; popupLayout.HeightRequest = 50; popupLayout.WidthRequest = 50; popupLayout.ShowRelativeToView(listview, RelativePosition.AlignBottom, 0, -20); }
private void AttachmentButtonTapped(object args) { AttachmentPopupView popupTemplate = new AttachmentPopupView(); popupTemplate.ViewModel = this; attachmentPopup = new SfPopupLayout(); attachmentPopup.PopupView.ShowHeader = false; attachmentPopup.PopupView.ShowFooter = false; attachmentPopup.PopupView.AnimationMode = AnimationMode.Fade; attachmentPopup.PopupView.PopupStyle.BorderThickness = 0; attachmentPopup.PopupView.PopupStyle.CornerRadius = 45; attachmentPopup.PopupView.WidthRequest = ((args as SfChat).Editor.Parent.Parent as View).Width; attachmentPopup.PopupView.HeightRequest = 170; DataTemplate bodyTemplateView = new DataTemplate(() => { return(popupTemplate); }); attachmentPopup.PopupView.ContentTemplate = bodyTemplateView; attachmentPopup.ShowRelativeToView((args as SfChat).Editor.Parent.Parent as View, RelativePosition.AlignTop, absoluteY: -5); }