0

How can I get current view/layout in Android Xamarin by CustomMapRenderer class? I want to add view in current layout at specific position.

In iOS I am doing it by following lines:

UIView XView;

XView.Frame = new CGRect(50,50,40,40);

Window.AddSubview(XView);
dur
  • 15,689
  • 25
  • 79
  • 125
SS_1
  • 1
  • 1

1 Answers1

0

Which View, specifically, are you after? The Xamarin Forms Map itself? Its container? The underlying native Android Control?

If you're after the native control, you have a reference to it in the Control Property of your renderer.

If you're after the Xamarin Forms wrapper for the native piece (a Map in this case), then you want to use the Element property of your renderer.

Both have a Parent property and the Element has a ParentView property.

ctacke
  • 66,480
  • 18
  • 94
  • 155
  • I am talking about main container view. And I have used parent property to get current view but it returns null. – SS_1 May 02 '17 at 12:50