title: Xamarin.Forms: Rendering Xamarin.Froms Control in native Dialog - wrap_content ignored
body: <p>Say I want to render a Xamarin.Froms control (e.g a <code>Xamarin.Forms.Label</code>) in a native android view.<br>
  The following code works. But ignores the width and height of the control (<code>wrap_content</code>).</p>
  
  <pre><code>// create a Xamarin.Froms.Label
  Xamarin.Forms.Label view = new Xamarin.Forms.Label()
  {
      Text = "This is a Xamarin.Forms.Label",
      BackgroundColor = Color.Red,
  };
  
  // create a Renderer
  var renderer = Xamarin.Forms.Platform.Android.Platform.CreateRenderer(view);
  
  // create an AlertDialog
  var builder = new AlertDialog.Builder(Xamarin.Forms.Forms.Context);
  builder.SetView(renderer.ViewGroup); // Use the ViewGroup of the renderer
  builder.SetTitle("Dialog");
  // create and show the dialog
  builder.Create().Show();
  </code></pre>
  
  <p>Produces the following:</p>
  
  <p><a href="https://i.stack.imgur.com/wE8VZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wE8VZm.png" alt="Xamarin.Forms.Label screenshot"></a></p>
  
  <p>Doing the same with an native label:</p>
  
  <pre><code>var view = new Android.Widget.TextView(Xamarin.Forms.Forms.Context)
  {
      Text = "This is a Android.Widget.TextView",
      Background = new Android.Graphics.Drawables.ColorDrawable(Android.Graphics.Color.Red),
  };
  var builder = new AlertDialog.Builder(Xamarin.Forms.Forms.Context);
  
  builder.SetView(view);
  builder.SetTitle("Dialog");
  builder.Create().Show();
  </code></pre>
  
  <p>Produces the expected output:</p>
  
  <p><a href="https://i.stack.imgur.com/isq7m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/isq7mm.png" alt="Android.Widget.TextView screenshot"></a></p>
  
  <p>I am looking for any hints or advices regarding width / height measurement in Xamarin.Forms, and/or a solution for this kind of problem.</p>
  
  <hr>
  
  <h2>Update</h2>
  
  <p>Also note that this does not depend on the <code>AlertDialog</code>, using a <code>LinearLayout</code> instead of a <code>AlertDialog</code> results to the same behaviour.</p>