1

I have been trying for a while to find the exact location of a grid and the button inside the grid I have on my screen. It is within many layers of Grids and StackLayouts, which have varying paddings.

I have tried using absolute layout, but it never puts the control i'm trying to draw over it in the correct place.

Grid g = new Grid;
g.BackGroundColor = Color.Pink;   
g.WidthRequest = 48;
g.HeightRequest = 48;
g.VerticalOptions = LayoutOptions.Start;
g.HorizontalOptions= LayoutOptions.Start;
g.TranslationX = AbsoluteLayout.GetLayoutBounds(LeftButton).Location.X;
g.TranslationY = AbsoluteLayout.GetLayoutBounds(LeftButton).Location.Y;
PageSizedGrid.Children.Add(g);
  • _"It is within many layers of Grids and StackLayouts"_ - you should probably re-think this layout approach as this is the best way to get into trouble with performance as well as running into layout difficulties (which it seems has happened here) – Keith Rome Jun 06 '16 at 16:06

0 Answers0